diff options
Diffstat (limited to 'src/encoding/xml/read_test.go')
| -rw-r--r-- | src/encoding/xml/read_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/encoding/xml/read_test.go b/src/encoding/xml/read_test.go index 391fe731a8..6ef55de77b 100644 --- a/src/encoding/xml/read_test.go +++ b/src/encoding/xml/read_test.go @@ -1079,3 +1079,18 @@ func TestUnmarshalWhitespaceAttrs(t *testing.T) { t.Fatalf("whitespace attrs: Unmarshal:\nhave: %#+v\nwant: %#+v", v, want) } } + +// golang.org/issues/53350 +func TestUnmarshalIntoNil(t *testing.T) { + type T struct { + A int `xml:"A"` + } + + var nilPointer *T + err := Unmarshal([]byte("<T><A>1</A></T>"), nilPointer) + + if err == nil { + t.Fatalf("no error in unmarshalling") + } + +} |
