protobuf-go/internal/encoding/json
Herbie Ong d3f8f2d412 internal/encoding/json: rewrite to a token-based encoder and decoder
Previous decoder decodes a JSON number into a float64, which lacks
64-bit integer precision.

I attempted to retrofit it with storing the raw bytes and parsed out
number parts, see golang.org/cl/164377.  While that is possible, the
encoding logic for Value is not symmetrical with the decoding logic and
can be confusing since both utilizes the same Value struct.

Joe and I decided that it would be better to rewrite the JSON encoder
and decoder to be token-based instead, removing the need for sharing a
model type plus making it more efficient.

Change-Id: Ic0601428a824be4e20141623409ab4d92b6167c7
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/165677
Reviewed-by: Damien Neil <dneil@google.com>
2019-03-11 21:53:21 +00:00
..
decode_test.go internal/encoding/json: rewrite to a token-based encoder and decoder 2019-03-11 21:53:21 +00:00
decode.go internal/encoding/json: rewrite to a token-based encoder and decoder 2019-03-11 21:53:21 +00:00
encode_test.go internal/encoding/json: rewrite to a token-based encoder and decoder 2019-03-11 21:53:21 +00:00
encode.go internal/encoding/json: rewrite to a token-based encoder and decoder 2019-03-11 21:53:21 +00:00
number.go internal/encoding/json: rewrite to a token-based encoder and decoder 2019-03-11 21:53:21 +00:00
string.go internal/encoding/json: rewrite to a token-based encoder and decoder 2019-03-11 21:53:21 +00:00
types.go internal/encoding/json: rewrite to a token-based encoder and decoder 2019-03-11 21:53:21 +00:00