You'll need to handle this case manually right now. It's something
that the datastore package should probably do.
Regardless of embedding, people want to do things like:
type Pair struct{ X, Y int }
type Foo struct {
XY Pair
Z int
}
and we eventually want to support this.
Although if we made datastore to do this with embedding, I think what
you'd end up with is properties named "Base.Field", not "Field". If
you wanted just "Field", then that might need more than what the
reflect package can
give. Embedded fields are just syntax; the A type doesn't have an
Field field, it has a Base field and Base has an Field field.
Andrew
That seems like a bug. File an issue?
I've currently run into the same problem, and am a bit disappointed that there's no straightforward way to handle this in Go. It looks like I should make specific "database structs" for storage, and convert them to real structs manually for everything I want to store. I suppose this could be good practice in general, but so far, I've been attempting to save work by having the structs I use be the same ones I store -- and I found this approach forced me to structure my app around the limitations of the datastore, which has been unpleasant -- and doesn't let me use the really cool parts of Go.Just a +1, I guess.