datastore: embedded structs docs
Add note into docs to remind users that anonymous struct fields are
treated as fields of embedding struct.
Fixes:
@@ -248,6 +248,15 @@ structs are themselves saved as Entity values. For example, given these definiti
then an Outer would have one property, Inner, encoded as an Entity value.
+Note: embedded struct fields must be named to be encoded as an Entity. For
+example, in case of a type Outer with an embedded field Inner:
+
+ type Outer struct {
+ Inner
+ }
+
+all the Inner struct fields will be treated as fields of Outer itself.
+
If an outer struct is tagged "noindex" then all of its implicit flattened
fields are effectively "noindex".
