My struct
type Result struct {
name string
Objects []struct {
id int
}
}
Initialize values for this
func main() {
var r Result;
r.name = "Vanaraj";
r.Objects[0].id = 10;
fmt.Println(r)
}
I got this error. "panic: runtime error: index out of range"
How to fix this?