Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

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

Fixes #586

Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
  • Loading branch information
mcastelino committed Oct 9, 2017
1 parent 8bc61b3 commit 4b906d5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cc-check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func TestCheckCheckCPUFlags(t *testing.T) {
for _, d := range data {
count, err := checkCPUFlags(d.cpuflags, d.required)
if d.expectError {
assert.Error(err, "%+v", d)
assert.Errorf(err, "%+v", d)
} else {
assert.NoError(err, "%+v", d)
}
Expand Down Expand Up @@ -280,7 +280,7 @@ func TestCheckCheckCPUAttribs(t *testing.T) {
for _, d := range data {
count, err := checkCPUAttribs(d.cpuinfo, d.required)
if d.expectError {
assert.Error(err, "%+v", d)
assert.Errorf(err, "%+v", d)
} else {
assert.NoError(err, "%+v", d)
}
Expand Down
14 changes: 7 additions & 7 deletions create_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,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 @@ -377,7 +377,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 @@ -424,7 +424,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 @@ -472,7 +472,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 @@ -647,7 +647,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 @@ -723,7 +723,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 @@ -849,7 +849,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 @@ -655,7 +655,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 4b906d5

Please sign in to comment.