From: Gustavo Niemeyer Date: Fri, 24 Feb 2012 19:45:32 +0000 (-0500) Subject: encoding/xml: fix anonymous field Unmarshal example X-Git-Tag: weekly.2012-03-04~162 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=490c3d4a426b197283bf3a02bedd84654a268f28;p=gostls13.git encoding/xml: fix anonymous field Unmarshal example R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5697043 --- diff --git a/src/pkg/encoding/xml/example_test.go b/src/pkg/encoding/xml/example_test.go index 082ce6803d..97c8c0b0dc 100644 --- a/src/pkg/encoding/xml/example_test.go +++ b/src/pkg/encoding/xml/example_test.go @@ -52,7 +52,7 @@ func ExampleMarshalIndent() { // This example demonstrates unmarshaling an XML excerpt into a value with // some preset fields. Note that the Phone field isn't modified and that -// the XML
element is ignored. Also, the Groups field is assigned +// the XML element is ignored. Also, the Groups field is assigned // considering the element path provided in its tag. func ExampleUnmarshal() { type Email struct { @@ -71,11 +71,11 @@ func ExampleUnmarshal() { Address } v := Result{Name: "none", Phone: "none"} - v.Address = Address{"Hanga Roa", "Easter Island"} data := ` Grace R. Emlin + Example Inc. gre@example.com @@ -86,7 +86,8 @@ func ExampleUnmarshal() { Friends Squash -
123 Main Street
+ Hanga Roa + Easter Island
` err := xml.Unmarshal([]byte(data), &v)