Open evanwht opened 2 years ago
Is there any plan to address this issue soon?
Right now, because of this issue, whenever developer add Load
and Save
to a struct, they have to check all the other struct that contain this struct as embedded field to see if they have Load
and Save
override as well. Since this is not checked by compiler, it's very easy to forget this check and have the bug leaked into production that only people who knows this issue can diagnose.
It's extremely annoying for a codebase with many different data models that interact with each other.
Client
Datastore v1.6.0
Environment
MacOS
Go Environment
go1.17.2 darwin/amd64 cloud.google.com/do/datastore v.1.16.0
Code
Expected behavior
I'm not actually sure if this behavior is what is intended but my thought would be that all fields are saved to datastore and loaded from datastore.
Actual behavior
EmbeddedField
is saved to datastore butField
is not. Additionally if an entity in datastore were to have both fields saved correctly only theEmbeddedField
is loaded into the struct correctly.Field
is left blank.If you implement PropertyLoadSaver on
MyStruct
thenField
is saved and loaded correctly.