Skip to content

Commit 820e30f

Browse files
SamWhitedianlancetaylor
authored andcommitted
encoding/xml: update docs to follow convention
Fixes #8833 Change-Id: I4523a1de112ed02371504e27882659bce8028a45 Reviewed-on: https://go-review.googlesource.com/24745 Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
1 parent 5a9d5c3 commit 820e30f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/encoding/xml/marshal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const (
3333
//
3434
// The name for the XML elements is taken from, in order of preference:
3535
// - the tag on the XMLName field, if the data is a struct
36-
// - the value of the XMLName field of type xml.Name
36+
// - the value of the XMLName field of type Name
3737
// - the tag of the struct field used to obtain the data
3838
// - the name of the struct field used to obtain the data
3939
// - the name of the marshalled type

src/encoding/xml/read.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
// ",innerxml", Unmarshal accumulates the raw XML nested inside the
4040
// element in that field. The rest of the rules still apply.
4141
//
42-
// * If the struct has a field named XMLName of type xml.Name,
42+
// * If the struct has a field named XMLName of type Name,
4343
// Unmarshal records the element name in that field.
4444
//
4545
// * If the XMLName field has an associated tag of the form
@@ -105,8 +105,8 @@ import (
105105
// interpreting the string value in decimal. There is no check for
106106
// overflow.
107107
//
108-
// Unmarshal maps an XML element to an xml.Name by recording the
109-
// element name.
108+
// Unmarshal maps an XML element to a Name by recording the element
109+
// name.
110110
//
111111
// Unmarshal maps an XML element to a pointer by setting the pointer
112112
// to a freshly allocated value and then mapping the element to that value.
@@ -115,13 +115,13 @@ func Unmarshal(data []byte, v interface{}) error {
115115
return NewDecoder(bytes.NewReader(data)).Decode(v)
116116
}
117117

118-
// Decode works like xml.Unmarshal, except it reads the decoder
118+
// Decode works like Unmarshal, except it reads the decoder
119119
// stream to find the start element.
120120
func (d *Decoder) Decode(v interface{}) error {
121121
return d.DecodeElement(v, nil)
122122
}
123123

124-
// DecodeElement works like xml.Unmarshal except that it takes
124+
// DecodeElement works like Unmarshal except that it takes
125125
// a pointer to the start XML element to decode into v.
126126
// It is useful when a client reads some raw XML tokens itself
127127
// but also wants to defer to Unmarshal for some elements.

0 commit comments

Comments
 (0)