summaryrefslogtreecommitdiff
path: root/encode.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-07 12:45:46 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-07 14:05:37 -0700
commit643cbc4d6e37d07619bec05039da1abb411d28d4 (patch)
tree68f771d5103d0243ed49b21ff896f01e49a81a72 /encode.go
parent2b9473f5e8816eeea76b2fdada184532be00d3a2 (diff)
Move struct-handling to internal/jsonstruct
Diffstat (limited to 'encode.go')
-rw-r--r--encode.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/encode.go b/encode.go
index ca4e060..fa558b9 100644
--- a/encode.go
+++ b/encode.go
@@ -16,6 +16,8 @@ import (
"strconv"
"strings"
"unsafe"
+
+ "git.lukeshu.com/go/lowmemjson/internal/jsonstruct"
)
// Encodable is the interface implemented by types that can encode
@@ -299,7 +301,7 @@ func encode(w *ReEncoder, val reflect.Value, escaper BackslashEscaper, quote boo
return err
}
empty := true
- for _, field := range indexStruct(val.Type()).byPos {
+ for _, field := range jsonstruct.IndexStruct(val.Type()).ByPos {
fVal, err := val.FieldByIndexErr(field.Path)
if err != nil {
continue