summaryrefslogtreecommitdiff
path: root/encode.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-02-07 14:06:12 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-02-07 14:06:12 -0700
commit480ccfd05a13ac36516c536a71203280a31b4d28 (patch)
tree4ae21bf95c9f3b4cce97a0a0473fe622fdb393eb /encode.go
parent87013d526ea1b0647ef6e08758fe587cee11d854 (diff)
parent47549aa3d10808c063d45dcaa598887dadde59c5 (diff)
Merge branch 'lukeshu/fixup'
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