<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
path: root/walk/read.go
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-04-26 09:24:38 +0100
committerCharlie Stanton <charlie@shtanton.xyz>2023-04-26 09:24:38 +0100
commite4c2e0165d349167a736e7f44a6b66bf8a4d668f (patch)
treef46c2bf27caf4f40756733702c919afb764cf1ba /walk/read.go
parent52fff75dbe45611e05b68646dd26329411425158 (diff)
downloadstred-go-e4c2e0165d349167a736e7f44a6b66bf8a4d668f.tar
Fix minor bug with a few cases where fillReadBuffer was returning the wrong structure
Diffstat (limited to 'walk/read.go')
-rw-r--r--walk/read.go4
1 files changed, 2 insertions, 2 deletions
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 {