title: Go XML unmarshal array
body: <p>I am trying to unmarshal a file that looks like this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;houses&gt;
    &lt;house name="Rhyves Flats 14" houseid="1" entryx="167" entryy="361" entryz="6" rent="0" townid="2" size="17" /&gt;
  &lt;/houses&gt;
  </code></pre>
  
  <p>With the following code</p>
  
  <pre><code>// House struct used for houses xml file
  type House struct {
      XMLName xml.Name `xml:"houses"`
      HouseID uint32 `xml:"houseid,attr"`
      Name    string `xml:"name,attr"`
      EntryX  uint16 `xml:"entryx,attr"`
      EntryY  uint16 `xml:"entryy,attr"`
      EntryZ  uint16 `xml:"entryz,attr"`
      Size    int    `xml:"size,attr"`
      TownID  uint32 `xml:"townid,attr"`
      Rent    int    `xml:"rent,attr"`
  }
  
  // LoadHouses parses the server map houses
  func LoadHouses(file string, list []House) error {
      // Load houses file
      f, err := ioutil.ReadFile(file)
  
      if err != nil {
          return err
      }
  
      // Unmarshal houses file
      return xml.Unmarshal(f, &amp;list)
  }
  </code></pre>
  
  <p>This is not returning any error. But the house slice is empty. Everything seems correct, the attrs are set and the XMLName too.</p>