Merge pull request #535 from ceh/vet-fixes

argument and verb formatting fixes reported by go vet
This commit is contained in:
Armon Dadgar 2014-11-19 15:46:01 -08:00
commit 8446b036d7
6 changed files with 12 additions and 12 deletions

View File

@ -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)
}
}
}

View File

@ -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)
}
}

View File

@ -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

View File

@ -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

View File

@ -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 {

View File

@ -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)
}
}
}