From e4c2e0165d349167a736e7f44a6b66bf8a4d668f Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Wed, 26 Apr 2023 09:24:38 +0100 Subject: Fix minor bug with a few cases where fillReadBuffer was returning the wrong structure --- walk/read.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'walk') diff --git a/walk/read.go b/walk/read.go index c98b941..00be010 100644 --- a/walk/read.go +++ b/walk/read.go @@ -266,7 +266,7 @@ func (in *JSONIn) fillReadBuffer(structure []JSONInStructure) ([]JSONInStructure value: { r, err := in.nextNonWsRune() if err != nil { - return structure, err + panic("Missing value in JSON") } switch r { case 'n': @@ -404,7 +404,7 @@ func (in *JSONIn) fillReadBuffer(structure []JSONInStructure) ([]JSONInStructure valueEnd: { r, err := in.nextNonWsRune() if err != nil { - return structure, err + return append(structure, JSONInValueEnd), err } underState := structure[len(structure) - 1] if underState == JSONInRoot { -- cgit v1.2.3