]> Cypherpunks repositories - gostls13.git/commit
encoding/json: Include the offset of a SyntaxError
authorMichael Fraenkel <michael.fraenkel@gmail.com>
Sun, 29 Oct 2017 00:50:57 +0000 (20:50 -0400)
committerJoe Tsai <joetsai@google.com>
Tue, 31 Oct 2017 22:44:14 +0000 (22:44 +0000)
commitf1ce59d988f02deb47c3fd33cbc40542726ea76c
tree54c492e4c099cf9bf3b0b5a006e971bd8f5ccf34
parent6fac1398303c95698880dd16877a8692e86ee15c
encoding/json: Include the offset of a SyntaxError

When a SyntaxError occurs, report the current offset within the stream.
The code already accounted for the offset within the current buffer
being scanned. By including how much data was already scanned, the
current offset can be computed.

Fixes #22478

Change-Id: I91ecd4cad0b85a5c1556bc597f3ee914e769af01
Reviewed-on: https://go-review.googlesource.com/74251
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/json/stream.go
src/encoding/json/stream_test.go