Skip to content

Commit

Permalink
follow golangci-lint advice
Browse files Browse the repository at this point in the history
avoid it :
  netif.go:56:6: S1002: should omit comparison to bool constant, can be simplified to `!addrPresent` (gosimple)
  • Loading branch information
Pascal Bourdier committed Feb 28, 2020
1 parent c3f261b commit c037a04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netif.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func EnsureDummyDevice(nl netlinkIf, ifName string, ensureIPs []net.IP, addrAdd
}
}

if addrPresent == false {
if !addrPresent {
if err := addrAdd(l, &netlink.Addr{IPNet: netlink.NewIPNet(ensureIP)}); err != nil {
return linkAlreadyPresent, fmt.Errorf("failed adding ip %s to interface %s: %s", ensureIP, ifName, err)
}
Expand Down

0 comments on commit c037a04

Please sign in to comment.