Skip to content

Commit

Permalink
fix golang lint error (#3323)
Browse files Browse the repository at this point in the history
Signed-off-by: 张祖建 <zhangzujian.7@gmail.com>
  • Loading branch information
zhangzujian committed Oct 23, 2023
1 parent df53f9f commit a0e68a4
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/daemon/ovs_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,12 +1169,11 @@ func getShortSharedDir(uid types.UID, volumeName string) string {
}

func linkExists(name string) (bool, error) {
_, err := netlink.LinkByName(name)
if err == nil {
return true, nil
} else if _, ok := err.(netlink.LinkNotFoundError); ok {
return false, nil
} else {
if _, err := netlink.LinkByName(name); err != nil {
if _, ok := err.(netlink.LinkNotFoundError); ok {
return false, nil
}
return false, err
}
return true, nil
}

0 comments on commit a0e68a4

Please sign in to comment.