diff --git a/pkg/yqlib/encoder.go b/pkg/yqlib/encoder.go index d050c84a..e9fae6af 100644 --- a/pkg/yqlib/encoder.go +++ b/pkg/yqlib/encoder.go @@ -45,11 +45,7 @@ func (o *orderedMap) UnmarshalJSON(data []byte) error { // cycle through k/v var tok json.Token - for tok, err = dec.Token(); !errors.Is(err, io.EOF); tok, err = dec.Token() { - if err != nil && !errors.Is(err, io.EOF) { - return err - } - + for tok, err = dec.Token(); err == nil; tok, err = dec.Token() { // we can expect two types: string or Delim. Delim automatically means // that it is the closing bracket of the object, whereas string means // that there is another key.