diff --git a/decode_test.go b/decode_test.go index 9431b83..349452b 100644 --- a/decode_test.go +++ b/decode_test.go @@ -269,9 +269,9 @@ func TestDecodeMap(t *testing.T) { ` out := &X{ A: map[string]string{"foo": "bar", "bar": "bang"}, - B: map[string][]string{"foo": []string{"a", "b", "c"}, "bar": []string{"1", "2", "3"}}, - C: map[string]map[string]string{"foo": map[string]string{"one": "1", "two": "2"}, "bar": map[string]string{"three": "3", "four": "4"}}, - D: map[string]S{"foo": S{"bar"}}, + B: map[string][]string{"foo": {"a", "b", "c"}, "bar": {"1", "2", "3"}}, + C: map[string]map[string]string{"foo": {"one": "1", "two": "2"}, "bar": {"three": "3", "four": "4"}}, + D: map[string]S{"foo": {"bar"}}, E: map[string]int{}, } testDecode(t, in, &X{}, out) diff --git a/parser.go b/parser.go index 5810598..430e4fc 100644 --- a/parser.go +++ b/parser.go @@ -83,5 +83,4 @@ func (p *parser) recover(errp *error) { } *errp = e.(error) } - return } diff --git a/properties_test.go b/properties_test.go index 47c3e13..7fc2e94 100644 --- a/properties_test.go +++ b/properties_test.go @@ -825,7 +825,7 @@ func TestWrite(t *testing.T) { n, err = p.Write(buf, ISO_8859_1) } assert.Equal(t, err, nil) - s := string(buf.Bytes()) + s := buf.String() assert.Equal(t, n, len(test.output), fmt.Sprintf("input=%q expected=%q obtained=%q", test.input, test.output, s)) assert.Equal(t, s, test.output, fmt.Sprintf("input=%q expected=%q obtained=%q", test.input, test.output, s)) } @@ -844,7 +844,7 @@ func TestWriteComment(t *testing.T) { n, err = p.WriteComment(buf, "# ", ISO_8859_1) } assert.Equal(t, err, nil) - s := string(buf.Bytes()) + s := buf.String() assert.Equal(t, n, len(test.output), fmt.Sprintf("input=%q expected=%q obtained=%q", test.input, test.output, s)) assert.Equal(t, s, test.output, fmt.Sprintf("input=%q expected=%q obtained=%q", test.input, test.output, s)) }