Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golangci to use revive #781

Merged
merged 1 commit into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ linters-settings:

linters:
enable:
- golint
- revive
- goimports
- varcheck
- unparam
Expand Down
6 changes: 1 addition & 5 deletions internal/vpn/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,7 @@ func (c *Client) AddDirectRoute(ip net.IP) error {
}
defer c.releaseSysPrivileges()

if err := c.setupDirectRoute(ip); err != nil {
return err
}

return nil
return c.setupDirectRoute(ip)
}

// RemoveDirectRoute removes direct route. Packets destined to `ip` will
Expand Down
6 changes: 1 addition & 5 deletions pkg/router/route_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,7 @@ func (rg *RouteGroup) sendNetworkProbe() error {

packet := routing.MakeNetworkProbePacket(rule.NextRouteID(), timestamp, throughput)

if err := rg.writePacket(context.Background(), tp, packet, rule.KeyRouteID()); err != nil {
return err
}

return nil
return rg.writePacket(context.Background(), tp, packet, rule.KeyRouteID())
}

func (rg *RouteGroup) networkProbeServiceFn(_ time.Duration) {
Expand Down
6 changes: 1 addition & 5 deletions pkg/setup/setupclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,7 @@ func (c *Client) Close() error {
return err
}

if err := c.conn.Close(); err != nil {
return err
}

return nil
return c.conn.Close()
}

// DialRouteGroup generates rules for routes from a visor and sends them to visors.
Expand Down
6 changes: 1 addition & 5 deletions pkg/snet/directtp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,7 @@ func (c *client) acceptConn() error {
return err
}

if err := lis.Introduce(wrappedConn); err != nil {
return err
}

return nil
return lis.Introduce(wrappedConn)
}

// Dial dials a new Conn to specified remote public key and port.
Expand Down
6 changes: 1 addition & 5 deletions pkg/util/pathutil/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ func AtomicWriteFile(filename string, data []byte) error {
return err
}

if err := rename.Rename(tempFilePath, filename); err != nil {
return err
}

return nil
return rename.Rename(tempFilePath, filename)
}

// AtomicAppendToFile calls AtomicWriteFile but appends new data to destiny file
Expand Down