Skip to content

Commit

Permalink
Merge pull request #781 from alexadhy/update-golangci
Browse files Browse the repository at this point in the history
Update golangci to use revive
  • Loading branch information
jdknives authored May 29, 2021
2 parents 56f7c36 + 7a678f2 commit ae14da5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 26 deletions.
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

0 comments on commit ae14da5

Please sign in to comment.