Skip to content

Commit

Permalink
go vet: Fix issues detected by go vet in go 1.9
Browse files Browse the repository at this point in the history
Fix issues flagged by go vet in go 1.9

Fixes clearcontainers#586

Signed-off-by: Manohar Castelino <[email protected]>
  • Loading branch information
mcastelino committed Sep 20, 2017
1 parent acecd7b commit 5213667
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ func TestCreateInvalidArgs(t *testing.T) {

for i, d := range data {
err := create(d.containerID, d.bundlePath, d.console, d.pidFilePath, d.detach, d.runtimeConfig)
assert.Error(err, "test %d (%+v)", i, d)
assert.Errorf(err, "test %d (%+v)", i, d)
}
}

Expand Down Expand Up @@ -367,7 +367,7 @@ func TestCreateInvalidConfigJSON(t *testing.T) {

for detach := range []bool{true, false} {
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
assert.Error(err, "%+v", detach)
assert.Errorf(err, "%+v", detach)
assert.False(vcMock.IsMockError(err))
}
}
Expand Down Expand Up @@ -414,7 +414,7 @@ func TestCreateInvalidContainerType(t *testing.T) {

for detach := range []bool{true, false} {
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
assert.Error(err, "%+v", detach)
assert.Errorf(err, "%+v", detach)
assert.False(vcMock.IsMockError(err))
}
}
Expand Down Expand Up @@ -462,7 +462,7 @@ func TestCreateContainerInvalid(t *testing.T) {

for detach := range []bool{true, false} {
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
assert.Error(err, "%+v", detach)
assert.Errorf(err, "%+v", detach)
assert.False(vcMock.IsMockError(err))
}
}
Expand Down Expand Up @@ -637,7 +637,7 @@ func TestCreateCreateCgroupsFilesFail(t *testing.T) {

for detach := range []bool{true, false} {
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
assert.Error(err, "%+v", detach)
assert.Errorf(err, "%+v", detach)
assert.False(vcMock.IsMockError(err))
}
}
Expand Down Expand Up @@ -713,7 +713,7 @@ func TestCreateCreateCreatePidFileFail(t *testing.T) {

for detach := range []bool{true, false} {
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
assert.Error(err, "%+v", detach)
assert.Errorf(err, "%+v", detach)
assert.False(vcMock.IsMockError(err))
}
}
Expand Down Expand Up @@ -839,7 +839,7 @@ func TestCreateInvalidKernelParams(t *testing.T) {

for detach := range []bool{true, false} {
err := create(testContainerID, bundlePath, testConsole, pidFilePath, true, runtimeConfig)
assert.Error(err, "%+v", detach)
assert.Errorf(err, "%+v", detach)
assert.False(vcMock.IsMockError(err))
}
}
Expand Down
2 changes: 1 addition & 1 deletion main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ func TestMainBeforeSubCommands(t *testing.T) {
err := beforeSubcommands(ctx)

if d.expectError {
assert.Error(err, "test %d (%+v)", i, d)
assert.Errorf(err, "test %d (%+v)", i, d)
} else {
assert.NoError(err, "test %d (%+v)", i, d)
}
Expand Down
2 changes: 1 addition & 1 deletion run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func TestRunInvalidArgs(t *testing.T) {

for i, a := range args {
err := run(a.containerID, a.bundle, a.console, a.consoleSocket, a.pidFile, a.detach, a.runtimeConfig)
assert.Error(err, "test %d (%+v)", i, a)
assert.Errorf(err, "test %d (%+v)", i, a)
}
}

Expand Down

0 comments on commit 5213667

Please sign in to comment.