We have a struct definition like this:
type TimeMs struct {
time.Time
}
And various of our datastore entity definitions include fields of this type, e.g.:
type Whatever struct {
Created TimeMs
}
In the past, this always worked fine without any special hackery on our part. If you examine these entities in the cloud console, the field's name was "Created." (note the trailing dot) which was a little odd but didn't seem to cause any problems. However, the latest versions of the cloud datastore package don't seem to play nicely with this. When we attempt to do a client.Put
, we get an error of:
unexpected error: rpc error: code = 3 desc = The flattened property.name is the empty string.
We also saw a recent commit of "if nested struct implements PLS, use it" which seemed potentially useful. So we tried making the TimeMs
struct implement PropertyLoadSaver (saving its anonymously-embedded time.Time as a property with Name=""), but this results in the same error.
It sure seems like this is a regression. Am I missing something? Is there some kind of workaround that we haven't thought of?
Please note that "just make it implement PropertyLoadSaver and save the Time with some non-empty Name" isn't really viable since we already have (literally) millions of entities stored using "" so it doesn't seem viable to migrate all of them.