4
如何聲明結構體數組?聲明結構字面數組
轉到:
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
天才。謝謝!將在7分鐘內接受 – user3918985 2014-09-24 08:06:31
我認爲最後還有一個額外的支架,應該只有2個 – pconcepcion 2017-09-27 18:08:56