diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2024-03-25 17:31:16 +0000 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2024-03-25 17:31:16 +0000 |
commit | 510a8c95ce112617c33f8dfb865e752db0716cb1 (patch) | |
tree | 4436165fb73891c5bde6f355b313d372827900b9 /json/write.go | |
parent | e9a296e8bc8f25138ea5910c8b09661f8ae25f10 (diff) | |
download | stred-go-510a8c95ce112617c33f8dfb865e752db0716cb1.tar |
Fix another bug in inMapAt and inArrayAt
Diffstat (limited to 'json/write.go')
-rw-r--r-- | json/write.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/json/write.go b/json/write.go index 334dfc0..3a5a621 100644 --- a/json/write.go +++ b/json/write.go @@ -217,7 +217,7 @@ func (writer *JSONWriter) inMapAt(keepLen int, path []walk.PathSegment) bool { return writer.state == JSONWriterStateInMap } - _, isString := writer.path[0].(string) + _, isString := writer.path[keepLen].(string) return isString } @@ -230,7 +230,7 @@ func (writer *JSONWriter) inArrayAt(keepLen int, path []walk.PathSegment) bool { return writer.state == JSONWriterStateInArray } - _, isInt := writer.path[0].(int) + _, isInt := writer.path[keepLen].(int) return isInt } |