lint: Clean up golangci-lint v1.60 complaints
This cleans up the linting results by adding checks for integer underflow/overflow in several places, suppressing the error in places where it has been checked, or fixing the types when possible.
This commit is contained in:
parent
2dad1a965e
commit
0256e09031
11 changed files with 47 additions and 12 deletions
|
|
@ -73,6 +73,8 @@ func newNetworkNamespace() (NetNS, error) {
|
|||
return "", fmt.Errorf("cannot unshare the network namespace")
|
||||
}
|
||||
defer func() {
|
||||
// The Fd() is actually an int cast into a uintptr, so casting back to an int is fine
|
||||
/* #nosec G115 */
|
||||
err = unix.Setns(int(oldNS.Fd()), syscall.CLONE_NEWNET)
|
||||
if err != nil {
|
||||
// We cannot return to the original namespace.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue