summaryrefslogtreecommitdiff
path: root/encode.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-26 22:31:32 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-29 21:01:42 -0700
commitff6dc0bc519886905e758a84e572f5e34d6c03d1 (patch)
tree8906c4b8bb0c7dc468419efc17b872db62a4e068 /encode.go
parentd1b5bc1f05624614f43ef85597f4aa9d7a166d23 (diff)
Move things between files
Diffstat (limited to 'encode.go')
-rw-r--r--encode.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/encode.go b/encode.go
index 41032e5..fa337ad 100644
--- a/encode.go
+++ b/encode.go
@@ -17,7 +17,6 @@ import (
"sort"
"strconv"
"strings"
- "unicode/utf8"
"unsafe"
)
@@ -426,28 +425,6 @@ func encode(w io.Writer, val reflect.Value, escaper BackslashEscaper, quote bool
}
}
-func encodeStringFromString(w io.Writer, escaper BackslashEscaper, str string) {
- encodeWriteByte(w, '"')
- for _, c := range str {
- if _, err := writeStringChar(w, c, BackslashEscapeNone, escaper); err != nil {
- panic(encodeError{err})
- }
- }
- encodeWriteByte(w, '"')
-}
-
-func encodeStringFromBytes(w io.Writer, escaper BackslashEscaper, str []byte) {
- encodeWriteByte(w, '"')
- for i := 0; i < len(str); {
- c, size := utf8.DecodeRune(str[i:])
- if _, err := writeStringChar(w, c, BackslashEscapeNone, escaper); err != nil {
- panic(encodeError{err})
- }
- i += size
- }
- encodeWriteByte(w, '"')
-}
-
func encodeArray(w io.Writer, val reflect.Value, escaper BackslashEscaper, cycleDepth uint, cycleSeen map[any]struct{}) {
encodeWriteByte(w, '[')
n := val.Len()