]> Cypherpunks repositories - gostls13.git/commit
encoding/json: make Number with the ,string option marshal with quotes
authorLucas Bremgartner <lucas@bremis.ch>
Fri, 13 Sep 2019 19:46:50 +0000 (19:46 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Mon, 16 Sep 2019 11:56:15 +0000 (11:56 +0000)
commit49e7c7672d6d065435f7058df90b082cb552c7dd
treec40efe6f98a52d3d0423dde073222cb79f6f7a3e
parentd9b8ffa51cf7cafe18107ec53a4ec3ceff15ce46
encoding/json: make Number with the ,string option marshal with quotes

Add quotes when marshaling a json.Number with the string option
set via a struct tag. This ensures that the resulting json
can be unmarshaled into the source struct without error.

Fixes #34268

Change-Id: Ide167d9dec77019554870b5957b37dc258119d81
GitHub-Last-Rev: dde81b71208be01c253bb87dbb6f81ac6e0785be
GitHub-Pull-Request: golang/go#34269
Reviewed-on: https://go-review.googlesource.com/c/go/+/195043
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/encoding/json/encode.go
src/encoding/json/encode_test.go