I have a Go struct:
type Foo struct{
Name: string
Age: int
}
I am able to save and retrieve Foos in datastore. So I may edit a Foo, I want to get the ID that datastore assigns a Foo, to use in an anchor. I verified that IDs are assigned using Google's datastore dashboard, but how do I get the ID off of a retrieved Foo?
GetAll
returns the keys along with any error.
keys, err := q.GetAll(c, &foos)
keys
is an array of datastore.Key