golang/go

encoding/json: Unmarshal & json.(*Decoder).Token report different values for SyntaxError.Offset for the same input

Open

#34,543 opened on Sep 25, 2019

View on GitHub
 (5 comments) (1 reaction) (0 assignees)Go (19,008 forks)batch import
NeedsInvestigationhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

What version of Go are you using (go version)?

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

What did you do?

https://play.golang.org/p/zkVEGITpYIo

What did you expect to see?

The same Offset for the two error cases, as it is the same input.

What did you see instead?

Different Offset.

Contributor guide