mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-13 22:38:04 +00:00
Simplified json error check
This commit is contained in:
parent
3435fee1f9
commit
c5994a8b28
@ -45,11 +45,7 @@ func (o *orderedMap) UnmarshalJSON(data []byte) error {
|
|||||||
|
|
||||||
// cycle through k/v
|
// cycle through k/v
|
||||||
var tok json.Token
|
var tok json.Token
|
||||||
for tok, err = dec.Token(); !errors.Is(err, io.EOF); tok, err = dec.Token() {
|
for tok, err = dec.Token(); err == nil; tok, err = dec.Token() {
|
||||||
if err != nil && !errors.Is(err, io.EOF) {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
// we can expect two types: string or Delim. Delim automatically means
|
// we can expect two types: string or Delim. Delim automatically means
|
||||||
// that it is the closing bracket of the object, whereas string means
|
// that it is the closing bracket of the object, whereas string means
|
||||||
// that there is another key.
|
// that there is another key.
|
||||||
|
Loading…
Reference in New Issue
Block a user