所以我有一個這樣的結構type Bus struct { Number string Name string DirectStations []Station // Station is another struct ReverseStations []Station}我正在嘗試將它的一個實例存儲到數據存儲區:key := datastore.NewKey(c, "Bus", bus.Number, 0, nil)_, err := datastore.Put(c, key, &bus)但我收到錯誤datastore: flattening nested structs leads to a slice of slices: field "DirectStations"怎么解決這個問題?編輯:原來你不能有一個結構片,其中該結構包含其他片。
- 2 回答
- 0 關注
- 192 瀏覽
添加回答
舉報
0/150
提交
取消