-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fixing some lint issues #2631
Fixing some lint issues #2631
Conversation
adaf37e
to
2d6bffe
Compare
libcontainer/cgroups/utils.go
Outdated
@@ -269,7 +269,6 @@ func RemovePaths(paths map[string]string) (err error) { | |||
} | |||
} | |||
if len(paths) == 0 { | |||
paths = make(map[string]string) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be kept #2628
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AkihiroSuda PTAL
2d6bffe
to
23e0f80
Compare
contrib/cmd/recvtty/recvtty.go
Outdated
err = console.ClearONLCR(c.Fd()) | ||
if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err = console.ClearONLCR(c.Fd()) | |
if err != nil { | |
if err := console.ClearONLCR(c.Fd()); if err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion applied in the squashed commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
23e0f80
to
7343c52
Compare
notify_socket.go
Outdated
client.Write([]byte(newPid + "\n")) | ||
_, err := client.Write([]byte(newPid + "\n")) | ||
if err != nil { | ||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean
return nil | |
return err |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
4c78fbf
to
8abbcfe
Compare
@kolyshkin @AkihiroSuda PTAL |
libcontainer/intelrdt/intelrdt.go
Outdated
@@ -294,8 +294,11 @@ func getIntelRdtRoot() (string, error) { | |||
} | |||
|
|||
func isIntelRdtMounted() bool { | |||
_, err := getIntelRdtRoot() | |||
return err == nil | |||
if _, err := getIntelRdtRoot(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This hunk looks weird. This was just fixed in commit e8eb800 and it seems you're reverting the change by mistake.
Signed-off-by: Amim Knabben <[email protected]>
8abbcfe
to
978fa6e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@AkihiroSuda @mrunalp PTAL |
Fixing some issues from #2627
contrib/cmd/recvtty/recvtty.go:108:20: Error return value of
console.ClearONLCR
is not checked (errcheck)libcontainer/cgroups/systemd/common.go:377:3: S1023: redundant
return
statement (gosimple)libcontainer/configs/validate/validator.go:231:5: S1002: should omit comparison to bool constant, can be simplified to
!symLink
(gosimple)libcontainer/container_linux.go:1531:2: S1006: should use for {} instead of for true {} (gosimple)
libcontainer/integration/checkpoint_test.go:238:2: SA4006: this value of
process
is never used (staticcheck)libcontainer/integration/checkpoint_test.go:258:12: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple)
libcontainer/integration/exec_test.go:282:11: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple)
libcontainer/integration/exec_test.go:285:12: S1030: should use stdout2.String() instead of string(stdout2.Bytes()) (gosimple)
libcontainer/integration/exec_test.go:328:15: S1030: should use stdout.String() instead of string(stdout.Bytes()) (gosimple)
libcontainer/integration/exec_test.go:1504:21: S1030: should use stdout2.String() instead of string(stdout2.Bytes())
(gosimple)
libcontainer/nsenter/nsenter_test.go:229:2: S1023: redundant
return
statement (gosimple)libcontainer/seccomp/config.go:65:29: S1002: should omit comparison to bool constant, can be simplified to
ok
(gosimple)libcontainer/seccomp/config.go:73:28: S1002: should omit comparison to bool constant, can be simplified to
ok
(gosimple)libcontainer/user/user_test.go:466:3: S1032: should use sort.Ints(...) instead of sort.Sort(sort.IntSlice(...)) (gosimple)
libcontainer/user/user_test.go:502:3: S1032: should use sort.Ints(...) instead of sort.Sort(sort.IntSlice(...)) (gosimple)
notify_socket.go:165:16: Error return value of
client.Write
is not checked (errcheck)