]> Cypherpunks repositories - gostls13.git/commitdiff
encoding/xml: add docs for ignoring tag
authorGustavo Niemeyer <gustavo@niemeyer.net>
Tue, 24 Jan 2012 23:04:40 +0000 (21:04 -0200)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Tue, 24 Jan 2012 23:04:40 +0000 (21:04 -0200)
That was supposed to be in the original CL, but missed
the files.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5570052

src/pkg/encoding/xml/marshal.go
src/pkg/encoding/xml/read.go

index 77413cb5735776aa3ca5c0373dd47709d84b3928..4ef2a50eaca1efc8f777754f651645be2e0a9eeb 100644 (file)
@@ -48,6 +48,7 @@ type Marshaler interface {
 // The XML element for a struct contains marshalled elements for each of the
 // exported fields of the struct, with these exceptions:
 //     - the XMLName field, described above, is omitted.
+//     - a field with tag "-" is omitted.
 //     - a field with tag "name,attr" becomes an attribute with
 //       the given name in the XML element.
 //     - a field with tag ",attr" becomes an attribute with the
index 8b23fd58a05a96f55d7a22989be849aa5257e162..871fe059cfa1880d0cf1790368b77048deb1bbff 100644 (file)
@@ -132,6 +132,8 @@ import (
 //      of the above rules and the struct has a field with tag ",any",
 //      unmarshal maps the sub-element to that struct field.
 //
+//   * A struct field with tag "-" is never unmarshalled into.
+//
 // Unmarshal maps an XML element to a string or []byte by saving the
 // concatenation of that element's character data in the string or
 // []byte. The saved []byte is never nil.