You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we provide a public function MarshalStruct for external calls, in case the caller just needs to add some extra fields to the marshal process but doesn't want to actually handle the marshal process himself?
For example:
// dynamodb tabletypeItemstruct {
PKstring`dynamo:",hash"`
}
typeUserstruct {
UsernamestringEmailstring
}
typeUserItemstruct {
*Item*User
}
// We want to add PK automatically in the marshal processfunc (u*User) MarshalDynamoItem() (map[string]*dynamodb.AttributeValue, error) {
returndynamo.MarshalStruct(&UserItem{&Item{PK:"U#"+u.Username}, u})
}
The text was updated successfully, but these errors were encountered:
Can we provide a public function
MarshalStruct
for external calls, in case the caller just needs to add some extra fields to the marshal process but doesn't want to actually handle the marshal process himself?For example:
The text was updated successfully, but these errors were encountered: