diff --git a/integration-cli/docker_utils_test.go b/integration-cli/docker_utils_test.go index f8c8fcdca88ac..5ae3aa44eafc8 100644 --- a/integration-cli/docker_utils_test.go +++ b/integration-cli/docker_utils_test.go @@ -81,9 +81,7 @@ func inspectFieldAndUnmarshall(c *testing.T, name, field string, output interfac c.Helper() str := inspectFieldJSON(c, name, field) err := json.Unmarshal([]byte(str), output) - if c != nil { - assert.Assert(c, err == nil, "failed to unmarshal: %v", err) - } + assert.Assert(c, err == nil, "failed to unmarshal: %v", err) } // Deprecated: use cli.Inspect @@ -105,9 +103,7 @@ func inspectFieldWithError(name, field string) (string, error) { func inspectField(c *testing.T, name, field string) string { c.Helper() out, err := inspectFilter(name, fmt.Sprintf(".%s", field)) - if c != nil { - assert.NilError(c, err) - } + assert.NilError(c, err) return out } @@ -115,9 +111,7 @@ func inspectField(c *testing.T, name, field string) string { func inspectFieldJSON(c *testing.T, name, field string) string { c.Helper() out, err := inspectFilter(name, fmt.Sprintf("json .%s", field)) - if c != nil { - assert.NilError(c, err) - } + assert.NilError(c, err) return out } @@ -125,9 +119,7 @@ func inspectFieldJSON(c *testing.T, name, field string) string { func inspectFieldMap(c *testing.T, name, path, field string) string { c.Helper() out, err := inspectFilter(name, fmt.Sprintf("index .%s %q", path, field)) - if c != nil { - assert.NilError(c, err) - } + assert.NilError(c, err) return out }