From 510a8c95ce112617c33f8dfb865e752db0716cb1 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Mon, 25 Mar 2024 17:31:16 +0000 Subject: Fix another bug in inMapAt and inArrayAt --- json/write.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'json/write.go') 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 } -- cgit v1.2.3