title: Unmarshal JSON in go with different types in a list
body: <p>I have trouble unmarschaling a JSON contruct:</p>
  
  <pre><code>{
    "id": 10,
    "result": [
      {
        "bundled": true,
        "type": "RM-J1100"
      },
      [
        {
          "name": "PowerOff",
          "value": "AAAAAQAAAAEAAAAvAw=="
        },
        {
          "name": "Input",
          "value": "AAAAAQAAAAEAAAAlAw=="
        }
      ]
    ]
  }
  </code></pre>
  
  <p>I actually need the second slice item from the result.</p>
  
  <p>My current attempt is </p>
  
  <pre><code>type Codes struct {
      Id     int32      `json:"id"`
      Result []interface{} `json:"result"`
  }
  
  type ResultList struct {
      Info  InfoMap
      Codes []Code
  }
  
  type InfoMap struct {
      Bundled bool   `json:"bundled"`
      Type    string `json:"type"`
  }
  
  type Code struct {
      Name  string `json:"name"`
      Value string `json:"value"`
  }
  </code></pre>
  
  <p>the output is like:</p>
  
  <pre><code>{10 {{false } []}}
  </code></pre>
  
  <p>but I also tried to use this:</p>
  
  <pre><code>type Codes struct {
      Id     int32      `json:"id"`
      Result []interface{} `json:"result"`
  }
  </code></pre>
  
  <p>the output is okay:</p>
  
  <pre><code>{10 [map[type:RM-J1100 bundled:true] [map[name:PowerOff value:AAAAAQAAAAEAAAAvAw==] map[name:Input value:AAAAAQAAAAEAAAAlAw==]]]}
  </code></pre>
  
  <p>I can also reference the Result[1] index:</p>
  
  <pre><code>[map[name:PowerOff value:AAAAAQAAAAEAAAAvAw==] map[name:Input value:AAAAAQAAAAEAAAAlAw==]]
  </code></pre>
  
  <p>But I fail to convert the interface type to any other Type which would match. Can anybody tell me how to do interface conversion. And what approach would be the "best".</p>