Skip to content

Instantly share code, notes, and snippets.

Created Mar 30, 2015
What would you like to do?
package main
import (
const data = `
<?xml version="1.0" encoding="UTF-8"?>
<liverailapi requested="/order/line/list" api_version="4.11.1">
type OrderLinesResponse struct {
XMLName xml.Name `xml:"liverailapi"`
OrderLines []OrderLine `xml:"lines>line"`
type OrderLine struct {
OrderId int `xml:"order_id"`
func main() {
var v OrderLinesResponse
if err := xml.Unmarshal([]byte(data), &v); err != nil {
for _, o := range v.OrderLines {
fmt.Printf("%p: %#v\n", &o, o)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment