title: Unmarshal Json data in a specific struct
body: <p>I want to unmarshal the following JSON data in Go:</p>
  
  <pre><code>b := []byte(`{"Asks": [[21, 1], [22, 1]] ,"Bids": [[20, 1], [19, 1]]}`)
  </code></pre>
  
  <p>I know how to do that, i define a struct like this:</p>
  
  <pre><code>type Message struct {
      Asks [][]float64 `json:"Bids"`
      Bids [][]float64 `json:"Asks"`
  }
  </code></pre>
  
  <p>What i don't know is if there is a simple way to specialize
  this a bit more.
  I would like to have the data after the unmarshaling in a format like this:</p>
  
  <pre><code>type Message struct {
      Asks []Order `json:"Bids"`
      Bids []Order `json:"Asks"`
  }
  
  type Order struct {
      Price float64
      Volume float64
  }
  </code></pre>
  
  <p>So that i can use it later after unmarshaling like this:</p>
  
  <pre><code>m := new(Message)
  err := json.Unmarshal(b, &amp;m)
  fmt.Println(m.Asks[0].Price)
  </code></pre>
  
  <p>I don't really know how to easy or idiomatically do that in GO
  so I hope that there is a nice solution for that.</p>