]> Cypherpunks repositories - gostls13.git/commit
[release-branch.r60] json: add struct tag option to wrap literals in strings
authorAndrew Gerrand <adg@golang.org>
Mon, 19 Sep 2011 01:59:19 +0000 (11:59 +1000)
committerAndrew Gerrand <adg@golang.org>
Mon, 19 Sep 2011 01:59:19 +0000 (11:59 +1000)
commit88102c4d10646f8fda317fc54814b4b9ddb780c3
tree0711ffd14d758562e8bd2117eeab6fc896138840
parentab046b2afa9c3ea4a480b087e7fdf2f1d599aaf2
[release-branch.r60] json: add struct tag option to wrap literals in strings

««« CL 4918051 / ba6daf799367
json: add struct tag option to wrap literals in strings

Since JavaScript doesn't have [u]int64 types, some JSON APIs
encode such types as strings to avoid losing precision.

This adds a new struct tag option ",string" to cause
fields to be wrapped in JSON strings on encoding
and unwrapped from strings when decoding.

R=rsc, gustavo
CC=golang-dev
https://golang.org/cl/4918051
»»»

R=dsymonds
CC=golang-dev
https://golang.org/cl/5049043
src/pkg/json/Makefile
src/pkg/json/decode.go
src/pkg/json/decode_test.go
src/pkg/json/encode.go
src/pkg/json/encode_test.go
src/pkg/json/tags.go [new file with mode: 0644]
src/pkg/json/tags_test.go [new file with mode: 0644]