aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/exec
diff options
context:
space:
mode:
authorKyle Lemons <kyle@kylelemons.net>2011-06-27 19:07:28 -0400
committerRuss Cox <rsc@golang.org>2011-06-27 19:07:28 -0400
commitabd50de296c129bbb4def693a6f1ebb66d6221f6 (patch)
tree6609a16011c8e4afed9f82934c292b00c8cfc120 /src/pkg/exec
parent9ded2b34516fa30ee7e79255ca8eeb5572364c19 (diff)
downloadgo-abd50de296c129bbb4def693a6f1ebb66d6221f6.tar.xz
xml: add Marshal and MarshalIndent
I have written up a Marshal and MarshalIndent pair that should closely reflect the way that Unmarshal works. I would love feedback on making this code more accessible and efficient... I haven't used reflecton on this scale before, so there is probably a lot of work that can be done on that. Some potentially controversial things: - All tag names are lower-cased by default. - Zero-valued struct values are skipped. - No namespace prefix (o:tag, etc) mechanism is supplied. - You are allowed to marshal non-struct values (even though unmarshal cannot handle them). - A tag for a non-XMLName struct field that isn't "attr", "chardata", or "innerxml" is used as the name of the tag. This could wreak havoc if you try to marshal a protobuf struct. - The "innerxml" and "chardata" are inserted verbatim. If you try to marshal something straight from unmarshal, the results could be unexpected (remove "innerxml" support from Marshal would be one possible solution). R=rsc CC=golang-dev https://golang.org/cl/4539082
Diffstat (limited to 'src/pkg/exec')
0 files changed, 0 insertions, 0 deletions