fix: linter issue

megacheck, gosimple and unused has been deprecated and subsumed by
staticcheck. And staticcheck also has been upgraded. we need to update
code for the linter issue.

close: #2945

Signed-off-by: Wei Fu <fuweid89@gmail.com>
This commit is contained in:
Wei Fu
2019-01-23 22:18:28 +08:00
parent 35582cb7a3
commit 132ee9b826
24 changed files with 42 additions and 61 deletions

View File

@@ -1120,7 +1120,7 @@ func TestDaemonRestartWithRunningShim(t *testing.T) {
}
pid := task.Pid()
if pid <= 0 {
if pid < 1 {
t.Fatalf("invalid task pid %d", pid)
}
@@ -1410,7 +1410,7 @@ func testUserNamespaces(t *testing.T, readonlyRootFS bool) {
t.Fatal(err)
}
if pid := task.Pid(); pid <= 0 {
if pid := task.Pid(); pid < 1 {
t.Errorf("invalid task pid %d", pid)
}
if err := task.Start(ctx); err != nil {