Skip to content

Commit b0cb29d

Browse files
committed
fix go vet errors
1 parent d14eb30 commit b0cb29d

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

json_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestMarshal(t *testing.T) {
3636
}
3737

3838
if len(m) != 3 {
39-
t.Errorf("expected three map elements, got ", len(m))
39+
t.Errorf("expected three map elements, got %d", len(m))
4040
}
4141

4242
if m["Message"].(string) != tc.msg {

option.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ var converters = map[reflect.Kind]converter{
106106
func (o *option) Parse(v string) (interface{}, error) {
107107
conv, ok := converters[o.Type()]
108108
if !ok {
109-
return nil, fmt.Errorf("option %q takes %s arguments, but was passed %q", o, o.Type, v)
109+
return nil, fmt.Errorf("option %q takes %s arguments, but was passed %q", o.Name(), o.Type(), v)
110110
}
111111

112112
return conv(v)

option_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ func TestParse(t *testing.T) {
8888
if err != nil && err.Error() != tc.err {
8989
t.Errorf("unexpected error: %s", err)
9090
} else if err == nil && tc.err != "" {
91-
t.Errorf("expected error %q but got nil")
91+
t.Errorf("expected error %q but got nil", tc.err)
9292
}
9393

9494
if v != tc.v {
95-
t.Error("expected %v but got %v", tc.v, v)
95+
t.Errorf("expected %v but got %v", tc.v, v)
9696
}
9797
}
9898
}

0 commit comments

Comments
 (0)