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:
Emil Hessman 2014-11-02 13:56:44 +01:00
parent 75472ecb8e
commit 4bfe18b40d
6 changed files with 12 additions and 12 deletions

View File

@ -53,10 +53,10 @@ func TestDiffTags(t *testing.T) {
cm := tagsToMap(c) cm := tagsToMap(c)
rm := tagsToMap(r) rm := tagsToMap(r)
if !reflect.DeepEqual(cm, tc.Create) { 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) { if !reflect.DeepEqual(rm, tc.Remove) {
t.Fatalf("%i: bad remove: %#v", i, rm) t.Fatalf("%d: bad remove: %#v", i, rm)
} }
} }
} }

View File

@ -98,7 +98,7 @@ func TestConfigValidate_countUserVar(t *testing.T) {
func TestConfigValidate_countVar(t *testing.T) { func TestConfigValidate_countVar(t *testing.T) {
c := testConfig(t, "validate-count-var") c := testConfig(t, "validate-count-var")
if err := c.Validate(); err != nil { 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) { func TestConfigValidate_pathVar(t *testing.T) {
c := testConfig(t, "validate-path-var") c := testConfig(t, "validate-path-var")
if err := c.Validate(); err != nil { if err := c.Validate(); err != nil {
t.Fatal("err: %s", err) t.Fatalf("err: %s", err)
} }
} }

View File

@ -88,7 +88,7 @@ func TestFileGetter_dirSymlink(t *testing.T) {
// Make a symlink // Make a symlink
if err := os.Symlink(dst2, dst); err != nil { 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 // With a dir that exists that isn't a symlink

View File

@ -338,7 +338,7 @@ func (m schemaMap) Input(
case TypeString: case TypeString:
value, err = m.inputString(input, k, v) value, err = m.inputString(input, k, v)
default: default:
panic(fmt.Sprintf("Unknown type for input: %s", v.Type)) panic(fmt.Sprintf("Unknown type for input: %#v", v.Type))
} }
if err != nil { if err != nil {
@ -653,7 +653,7 @@ func (m schemaMap) diffString(
var err error var err error
n, err = schema.DefaultFunc() n, err = schema.DefaultFunc()
if err != nil { 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} return nil, []error{err}
} }
default: default:
panic(fmt.Sprintf("Unknown validation type: %s", schema.Type)) panic(fmt.Sprintf("Unknown validation type: %#v", schema.Type))
} }
return nil, nil return nil, nil

View File

@ -175,7 +175,7 @@ func (c *Context) Input(mode InputMode) error {
case config.VariableTypeString: case config.VariableTypeString:
// Good! // Good!
default: default:
panic(fmt.Sprintf("Unknown variable type: %s", v.Type())) panic(fmt.Sprintf("Unknown variable type: %#v", v.Type()))
} }
var defaultString string var defaultString string
@ -483,7 +483,7 @@ func (c *walkContext) Walk() error {
case walkValidate: case walkValidate:
walkFn = c.validateWalkFn() walkFn = c.validateWalkFn()
default: default:
panic(fmt.Sprintf("unknown operation: %s", c.Operation)) panic(fmt.Sprintf("unknown operation: %#v", c.Operation))
} }
if err := g.Walk(walkFn); err != nil { if err := g.Walk(walkFn); err != nil {

View File

@ -97,7 +97,7 @@ func TestModuleDiff_ChangeType(t *testing.T) {
for i, tc := range cases { for i, tc := range cases {
actual := tc.Diff.ChangeType() actual := tc.Diff.ChangeType()
if actual != tc.Result { 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 { for i, tc := range cases {
actual := tc.Diff.ChangeType() actual := tc.Diff.ChangeType()
if actual != tc.Result { if actual != tc.Result {
t.Fatalf("%d: %s", i, actual) t.Fatalf("%d: %#v", i, actual)
} }
} }
} }