encoding/xml: improve package based on the suggestions from metalinter

Existing code in encoding/xml packages contains code which breaks
various linter rules (comments, constant and variable naming, variable
shadowing, etc).

Fixes #21578

Change-Id: Id4bd9a9be6d5728ce88fb6efe33030ef943c078c
Reviewed-on: https://go-review.googlesource.com/58210
Reviewed-by: Sam Whited <sam@samwhited.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Sam Whited <sam@samwhited.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Karel Pazdera 2017-08-24 00:36:28 +02:00 committed by Ian Lance Taylor
parent 77b4beba2f
commit 6e9e9dfa46
8 changed files with 103 additions and 94 deletions

View file

@ -479,15 +479,15 @@ func TestAllScalars(t *testing.T) {
}
type item struct {
Field_a string
FieldA string
}
func TestIssue569(t *testing.T) {
data := `<item><Field_a>abcd</Field_a></item>`
data := `<item><FieldA>abcd</FieldA></item>`
var i item
err := Unmarshal([]byte(data), &i)
if err != nil || i.Field_a != "abcd" {
if err != nil || i.FieldA != "abcd" {
t.Fatal("Expecting abcd")
}
}