diff options
| author | Russ Cox <rsc@golang.org> | 2017-11-14 14:01:11 -0500 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2017-11-15 21:27:07 +0000 |
| commit | 894869e1508d3b6a8e6bbbdbb7603cdd77d23162 (patch) | |
| tree | 1d9c7551bd77c0ae186742bd0085eb36f482333b /src/encoding/xml/xml.go | |
| parent | c4c3f2a1f2d9ee0735aba1583bb2a3301ec790d3 (diff) | |
| download | go-894869e1508d3b6a8e6bbbdbb7603cdd77d23162.tar.xz | |
encoding/xml: move unexported const out of exported const block
CL 58210 introduced this constant for reasons I don't understand.
It should not be in the exported const block, which will pollute
godoc output with a "... unexported" notice.
Also since we already have a constant named xmlnsPrefix for "xmlns",
it is very confusing to also have xmlNamespacePrefix for "xml".
If we must have the constant at all, rename it to xmlPrefix.
Change-Id: I15f937454d730005816fcd32b1acca703acf1e51
Reviewed-on: https://go-review.googlesource.com/78121
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/encoding/xml/xml.go')
| -rw-r--r-- | src/encoding/xml/xml.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/encoding/xml/xml.go b/src/encoding/xml/xml.go index 7556d4b876..f408623de5 100644 --- a/src/encoding/xml/xml.go +++ b/src/encoding/xml/xml.go @@ -338,6 +338,7 @@ func (d *Decoder) Token() (Token, error) { const ( xmlURL = "http://www.w3.org/XML/1998/namespace" xmlnsPrefix = "xmlns" + xmlPrefix = "xml" ) // Apply name space translation to name n. @@ -349,7 +350,7 @@ func (d *Decoder) translate(n *Name, isElementName bool) { return case n.Space == "" && !isElementName: return - case n.Space == xmlNamespacePrefix: + case n.Space == xmlPrefix: n.Space = xmlURL case n.Space == "" && n.Local == xmlnsPrefix: return |
