Skip to content

Commit c5994a8

Browse files
committed
Simplified json error check
1 parent 3435fee commit c5994a8

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

pkg/yqlib/encoder.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ func (o *orderedMap) UnmarshalJSON(data []byte) error {
4545

4646
// cycle through k/v
4747
var tok json.Token
48-
for tok, err = dec.Token(); !errors.Is(err, io.EOF); tok, err = dec.Token() {
49-
if err != nil && !errors.Is(err, io.EOF) {
50-
return err
51-
}
52-
48+
for tok, err = dec.Token(); err == nil; tok, err = dec.Token() {
5349
// we can expect two types: string or Delim. Delim automatically means
5450
// that it is the closing bracket of the object, whereas string means
5551
// that there is another key.

0 commit comments

Comments
 (0)