【发布时间】:2014-09-24 16:01:29
【问题描述】:
如何声明结构字面量数组?
去:
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
【问题讨论】:
标签: go