diff --git a/unvis.go b/unvis.go index f8dd6b1..8a26218 100644 --- a/unvis.go +++ b/unvis.go @@ -74,7 +74,7 @@ func newParser(input string, flag VisFlag) *unvisParser { func unvisPlainRune(p *unvisParser) ([]byte, error) { ch, err := p.Peek() if err != nil { - return nil, fmt.Errorf("plain rune: %s", ch) + return nil, fmt.Errorf("plain rune: %c", ch) } p.Next() @@ -238,8 +238,6 @@ func unvisEscapeSequence(p *unvisParser) ([]byte, error) { default: return unvisEscapeCStyle(p) } - - return nil, fmt.Errorf("escape sequence: unsupported sequence: %q", ch) } func unvisRune(p *unvisParser) ([]byte, error) { diff --git a/vis_test.go b/vis_test.go index e4ef083..5177a58 100644 --- a/vis_test.go +++ b/vis_test.go @@ -121,7 +121,7 @@ func TestVisChanged(t *testing.T) { t.Errorf("unexpected error with %q: %s", test, err) } if enc == test { - t.Errorf("expected encoding of %q to be changed") + t.Errorf("expected encoding of %q to be changed", test) } } }