title: Proper json unmarshaling in Go with the empty interface
body: <p>I'm currently learning golang and (probably as many others before me) I'm trying to properly understand the empty interface.</p>
  <p>As an exercise, I'm reading a big json file produced by Postman and trying to access just one field (out of the many available).</p>
  <p>Here is a simple representation of the json without the unnecessary fields I don't want to read (<strong>but that are still there</strong>):</p>
  <pre><code>{
      &quot;results&quot;: [
          {
              &quot;times&quot;: [
                  1,
                  2,
                  3,
                  4
                  ]
          }
      ]
  }
  </code></pre>
  <p>Since the json object is big, I opted out of unmarshaling it with a custom struct, and rather decided to use the empty interface <code>interface{}</code></p>
  <p>After some time, I managed to get some working code, but I'm quite sure this isn't the correct way of doing it.</p>
  <pre><code>byteValue, _ := ioutil.ReadAll(jsonFile)
  
  var result map[string]interface{}
  err = json.Unmarshal(byteValue, &amp;result)
  if err != nil {
      log.Fatalln(err)
  }
  
  // ESPECIALLY UGLY
  r := result[&quot;results&quot;].([]interface{})
  r1 := r[0].(map[string]interface{})
  r2 := r1[&quot;times&quot;].([]interface{})
  
  times := make([]float64, len(r2))
  for i := range r2 {
      times[i] = r2[i].(float64)
  }
  </code></pre>
  <p>Is there a better way to navigate through my json object without having to instantiate new variables every time i move deeper and deeper into the object?</p>