here is my struct:
type AreaPrerequisite struct {
SideQuestId int //
SideQuestProg int // progress
}
type AreaInfo struct {
Id int `datastore:""`
Name string `datastore:",noindex"`
ActionPoint int `datastore:",noindex"`
Prerequisite AreaPrerequisite `datastore:",noindex"`
// ignored:
DsMonsters []byte `datastore:"-"`
DsStages []byte `datastore:"-"`
Monsters AreaMonsters `datastore:"-"`
Stages []*StageEntry `datastore:"-"`
}
and my put() call:
key := datastore.NewKey(c, "Area", "", int64(pArea.Id), nil)
_, err := datastore.Put(c, key, *pArea)
if err != nil {
return err
}
It gives me the following error when try to put to DS:
datastore: invalid entity type
I checked the doc: https://developers.google.com/appengine/docs/go/datastore/reference
datastore:"-" should mark some non-supported fields ignored by datastore. Don't know why it is failing.
I found that I accidentally added * to pArea as arg to put() so it is passing a value instead of pointer, causing invalid entity type error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With