argument and verb formatting fixes reported by go vet
builtin/providers/aws/tags_test.go:56: unrecognized printf verb 'i'
builtin/providers/aws/tags_test.go:59: unrecognized printf verb 'i'
config/config_test.go:101: possible formatting directive in Fatal call
config/config_test.go:157: possible formatting directive in Fatal call
config/module/get_file_test.go:91: missing argument for Fatalf(%s): format reads arg 1, have only 0 args
helper/schema/schema.go:341: arg v.Type for printf verb %s of wrong type: schema.ValueType
helper/schema/schema.go:656: missing argument for Errorf(%s): format reads arg 2, have only 1 args
helper/schema/schema.go:912: arg schema.Type for printf verb %s of wrong type: schema.ValueType
terraform/context.go:178: arg v.Type() for printf verb %s of wrong type: github.com/hashicorp/terraform/config.VariableType
terraform/context.go:486: arg c.Operation for printf verb %s of wrong type: terraform.walkOperation
terraform/diff_test.go💯 arg actual for printf verb %s of wrong type: terraform.DiffChangeType
terraform/diff_test.go:235: arg actual for printf verb %s of wrong type: terraform.DiffChangeType
This commit is contained in:
parent
75472ecb8e
commit
4bfe18b40d
|
@ -53,10 +53,10 @@ func TestDiffTags(t *testing.T) {
|
|||
cm := tagsToMap(c)
|
||||
rm := tagsToMap(r)
|
||||
if !reflect.DeepEqual(cm, tc.Create) {
|
||||
t.Fatalf("%i: bad create: %#v", i, cm)
|
||||
t.Fatalf("%d: bad create: %#v", i, cm)
|
||||
}
|
||||
if !reflect.DeepEqual(rm, tc.Remove) {
|
||||
t.Fatalf("%i: bad remove: %#v", i, rm)
|
||||
t.Fatalf("%d: bad remove: %#v", i, rm)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ func TestConfigValidate_countUserVar(t *testing.T) {
|
|||
func TestConfigValidate_countVar(t *testing.T) {
|
||||
c := testConfig(t, "validate-count-var")
|
||||
if err := c.Validate(); err != nil {
|
||||
t.Fatal("err: %s", err)
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ func TestConfigValidate_outputBadField(t *testing.T) {
|
|||
func TestConfigValidate_pathVar(t *testing.T) {
|
||||
c := testConfig(t, "validate-path-var")
|
||||
if err := c.Validate(); err != nil {
|
||||
t.Fatal("err: %s", err)
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ func TestFileGetter_dirSymlink(t *testing.T) {
|
|||
|
||||
// Make a symlink
|
||||
if err := os.Symlink(dst2, dst); err != nil {
|
||||
t.Fatalf("err: %s")
|
||||
t.Fatalf("err: %s", err)
|
||||
}
|
||||
|
||||
// With a dir that exists that isn't a symlink
|
||||
|
|
|
@ -338,7 +338,7 @@ func (m schemaMap) Input(
|
|||
case TypeString:
|
||||
value, err = m.inputString(input, k, v)
|
||||
default:
|
||||
panic(fmt.Sprintf("Unknown type for input: %s", v.Type))
|
||||
panic(fmt.Sprintf("Unknown type for input: %#v", v.Type))
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
@ -653,7 +653,7 @@ func (m schemaMap) diffString(
|
|||
var err error
|
||||
n, err = schema.DefaultFunc()
|
||||
if err != nil {
|
||||
return fmt.Errorf("%s, error loading default: %s", err)
|
||||
return fmt.Errorf("%s, error loading default: %s", k, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -909,7 +909,7 @@ func (m schemaMap) validatePrimitive(
|
|||
return nil, []error{err}
|
||||
}
|
||||
default:
|
||||
panic(fmt.Sprintf("Unknown validation type: %s", schema.Type))
|
||||
panic(fmt.Sprintf("Unknown validation type: %#v", schema.Type))
|
||||
}
|
||||
|
||||
return nil, nil
|
||||
|
|
|
@ -175,7 +175,7 @@ func (c *Context) Input(mode InputMode) error {
|
|||
case config.VariableTypeString:
|
||||
// Good!
|
||||
default:
|
||||
panic(fmt.Sprintf("Unknown variable type: %s", v.Type()))
|
||||
panic(fmt.Sprintf("Unknown variable type: %#v", v.Type()))
|
||||
}
|
||||
|
||||
var defaultString string
|
||||
|
@ -483,7 +483,7 @@ func (c *walkContext) Walk() error {
|
|||
case walkValidate:
|
||||
walkFn = c.validateWalkFn()
|
||||
default:
|
||||
panic(fmt.Sprintf("unknown operation: %s", c.Operation))
|
||||
panic(fmt.Sprintf("unknown operation: %#v", c.Operation))
|
||||
}
|
||||
|
||||
if err := g.Walk(walkFn); err != nil {
|
||||
|
|
|
@ -97,7 +97,7 @@ func TestModuleDiff_ChangeType(t *testing.T) {
|
|||
for i, tc := range cases {
|
||||
actual := tc.Diff.ChangeType()
|
||||
if actual != tc.Result {
|
||||
t.Fatalf("%d: %s", i, actual)
|
||||
t.Fatalf("%d: %#v", i, actual)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -232,7 +232,7 @@ func TestInstanceDiff_ChangeType(t *testing.T) {
|
|||
for i, tc := range cases {
|
||||
actual := tc.Diff.ChangeType()
|
||||
if actual != tc.Result {
|
||||
t.Fatalf("%d: %s", i, actual)
|
||||
t.Fatalf("%d: %#v", i, actual)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue