Skip to content

Commit

Permalink
Return error in the error branch
Browse files Browse the repository at this point in the history
This change fixes the issue when there is an error in decoding, where
the original code would return no error and false for ok. That would
confuse the calling function.
  • Loading branch information
Nikola Knezevic authored and ianlopshire committed May 20, 2023
1 parent 41ae6b5 commit 03add0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (d *Decoder) readLine(v reflect.Value) (err error, ok bool) {

rawValue, err := newRawValue(line, d.useCodepointIndices)
if err != nil {
return
return err, false
}
t := v.Type()
if t == d.lastType {
Expand Down

0 comments on commit 03add0a

Please sign in to comment.