If there are no tags, the rules are the same as before.
If there is a tagged field, choose it if there is exactly one
at the top level of all fields.
More tests. The old tests were clearly inadequate, since
they all pass as is. The new tests only work with the new code.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/8617044
The old code was incorrect and also broken. It passed the tests by accident.
The new algorithm is:
1) Sort the fields in order of names.
2) For all fields with the same name, sort in increasing depth.
3) Choose the single field with shortest depth.
If any of the fields of a given name has a tag, do the above using
tagged fields of that name only.
Fixes#5245.
R=iant
CC=golang-dev
https://golang.org/cl/8583044
Add a check for this case and don't try to follow the anonymous
type's non-existent fields.
Fixes#4474.
R=rsc
CC=golang-dev
https://golang.org/cl/6945065
Number represents the actual JSON text,
preserving the precision and
formatting of the original input.
R=rsc, iant
CC=golang-dev
https://golang.org/cl/6202068
I've elected to omit escaping the output of Marshalers for now.
I haven't thought through the implications of that;
I suspect that double escaping might be the undoing of that idea.
Fixes#3127.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5694098
We should, after Go 1, make them work the same as
package xml, that is, make them appear in the outer
struct. For now turn them off so that people do not
depend on the old behavior.
Fixing them is issue 3069.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656102
Before/after, best of 3:
json.BenchmarkCodeEncoder 10 183495300 ns/op 10.58 MB/s
->
json.BenchmarkCodeEncoder 10 133025100 ns/op 14.59 MB/s
But don't get too excited about this. These benchmarks, while
stable at any point of time, fluctuate wildly with any line of
code added or removed anywhere in the path due to stack splitting
issues.
It's currently much faster, though, and this is the API that
doesn't allocate so should always be faster in theory.
R=golang-dev, dsymonds, rsc, r, gri
CC=golang-dev
https://golang.org/cl/5411052
All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.
No attempt is made to use the new Append functions
even though there are definitely opportunities.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
This is Go 1 package renaming CL #1.
This one merely moves the source; the import strings will be
changed after the next weekly release.
The only edits are in Makefiles.
R=r, rsc
CC=golang-dev
https://golang.org/cl/5331060