go/src/pkg/json
Brad Fitzpatrick 596bf61d6c 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
2011-08-29 12:46:32 -07:00
..
Makefile json: add struct tag option to wrap literals in strings 2011-08-29 12:46:32 -07:00
decode.go json: add struct tag option to wrap literals in strings 2011-08-29 12:46:32 -07:00
decode_test.go json: add struct tag option to wrap literals in strings 2011-08-29 12:46:32 -07:00
encode.go json: add struct tag option to wrap literals in strings 2011-08-29 12:46:32 -07:00
encode_test.go json: add struct tag option to wrap literals in strings 2011-08-29 12:46:32 -07:00
indent.go json: calculate Offset for Indent correctly 2011-08-22 15:19:27 +10:00
scanner.go json: keep track of error offset in SyntaxError 2011-04-15 08:14:34 -07:00
scanner_test.go json: calculate Offset for Indent correctly 2011-08-22 15:19:27 +10:00
stream.go json: keep track of error offset in SyntaxError 2011-04-15 08:14:34 -07:00
stream_test.go delete float, complex - code changes 2011-01-19 23:09:00 -05:00
tagkey_test.go json: allow using '$' and '-' as the struct field's tag 2011-07-13 17:41:33 -07:00
tags.go json: add struct tag option to wrap literals in strings 2011-08-29 12:46:32 -07:00
tags_test.go json: add struct tag option to wrap literals in strings 2011-08-29 12:46:32 -07:00