1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:40:22 -07:00

encoding/xml: add docs for ignoring tag

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
This commit is contained in:
Gustavo Niemeyer 2012-01-24 21:04:40 -02:00
parent 0bb8ce2984
commit e3ab30bbc1
2 changed files with 3 additions and 0 deletions

View File

@ -48,6 +48,7 @@ type Marshaler interface {
// The XML element for a struct contains marshalled elements for each of the // The XML element for a struct contains marshalled elements for each of the
// exported fields of the struct, with these exceptions: // exported fields of the struct, with these exceptions:
// - the XMLName field, described above, is omitted. // - the XMLName field, described above, is omitted.
// - a field with tag "-" is omitted.
// - a field with tag "name,attr" becomes an attribute with // - a field with tag "name,attr" becomes an attribute with
// the given name in the XML element. // the given name in the XML element.
// - a field with tag ",attr" becomes an attribute with the // - a field with tag ",attr" becomes an attribute with the

View File

@ -132,6 +132,8 @@ import (
// of the above rules and the struct has a field with tag ",any", // of the above rules and the struct has a field with tag ",any",
// unmarshal maps the sub-element to that struct field. // 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 // Unmarshal maps an XML element to a string or []byte by saving the
// concatenation of that element's character data in the string or // concatenation of that element's character data in the string or
// []byte. The saved []byte is never nil. // []byte. The saved []byte is never nil.