title: How to initialize values for nested struct array in golang
body: <p>My struct </p>
  
  <pre><code>type Result struct {
     name   string
     Objects []struct {
         id int
     }
  }
  </code></pre>
  
  <p>Initialize values for this</p>
  
  <pre><code>func main() {
     var r Result;
     r.name  = "Vanaraj";
     r.Objects[0].id = 10;
     fmt.Println(r)
  }
  </code></pre>
  
  <p>I got this error. "panic: runtime error: index out of range"</p>
  
  <p>How to fix this?</p>