summaryrefslogtreecommitdiff
path: root/encode_string.go
diff options
context:
space:
mode:
Diffstat (limited to 'encode_string.go')
-rw-r--r--encode_string.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/encode_string.go b/encode_string.go
index 328b07a..208aef4 100644
--- a/encode_string.go
+++ b/encode_string.go
@@ -5,6 +5,7 @@
package lowmemjson
import (
+ "fmt"
"io"
"unicode/utf8"
@@ -40,7 +41,7 @@ func writeStringShortEscape(w io.Writer, c rune) (int, error) {
case '\t':
b = 't'
default:
- panic("should not happen")
+ panic(fmt.Errorf("should not happen: writeStringShortEscape called with invalid rune: %q", c))
}
buf := [2]byte{'\\', b}
return w.Write(buf[:])