I get an out of range error when I run this code:
Go:
type Ping struct {
Content []aContent
}
type aContent struct {
Type string
Id string
Created_at int64
}
var p Ping
func main() {
f := Ping{Content: []aContent{{Type: "Hello", Id: "asdf"}}}
fmt.Println(f)
fmt.Println(p.Content[0].Created_at) //what's wrong?
}
What's wrong? The code can be found here: http://play.golang.org/p/uZm5LaUuGW