Skip to content

Commit

Permalink
Merge pull request clearcontainers#587 from mcastelino/topic/govet
Browse files Browse the repository at this point in the history
Fix go vet issues flagged by go 1.9
  • Loading branch information
jodh-intel authored Sep 25, 2017
2 parents 7e2466d + 5213667 commit 535be19
Show file tree
Hide file tree
Showing 11 changed files with 825 additions and 118 deletions.
2 changes: 1 addition & 1 deletion Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
7 changes: 4 additions & 3 deletions vendor/github.com/stretchr/testify/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 535be19

Please sign in to comment.