Skip to content

Instantly share code, notes, and snippets.

@mandolyte
Created December 15, 2017 17:01
Show Gist options
  • Save mandolyte/d383d60874a7f18f152934f7e3f89d31 to your computer and use it in GitHub Desktop.
Save mandolyte/d383d60874a7f18f152934f7e3f89d31 to your computer and use it in GitHub Desktop.
$ 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