我该如何声明一个结构体数组字面量?
Go:
type Ping struct {
Content []aContent
}
type aContent struct {
Type string
Id string
Created_at int64
}
func main() {
f := Ping{Content: []aContent{Type: "Hello", Id: "asdf"}}
fmt.Println(f)
}
这里可以找到代码:http://play.golang.org/p/-SyRw6dDUm