Created
December 15, 2017 17:01
-
-
Save mandolyte/d383d60874a7f18f152934f7e3f89d31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat identityxform.go | |
package main | |
import ( | |
"encoding/xml" | |
"fmt" | |
"os" | |
"strings" | |
) | |
func main() { | |
data := ` | |
<Person> | |
<FullName>Grace R. Emlin</FullName> | |
<Company>Example Inc.</Company> | |
</Person> | |
` | |
decoder := xml.NewDecoder(strings.NewReader(data)) | |
encoder := xml.NewEncoder(os.Stdout) | |
if err := encoder.Encode(decoder); err != nil { | |
fmt.Printf("error: %v\n", err) | |
} | |
} | |
$ go run identityxform.go | |
error: xml: unsupported type: map[string]string | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment