I have a model:
type UserProfile struct {
UserID string `datastore:"user_id" json:"user_id,omitempty"`
Username string `datastore:"username" json:"username,omitempty"`
StripUsername string `datastore:"strip_username" json:"strip_username,omitempty"`
Email string `datastore:"email" json:"email,omitempty"`
LoginType string `datastore:"login_type" json:"login_type,omitempty"`
CurrentSession string `datastore:"current_session" json:"current_session,omitempty"`
FBAcessToken string `datastore:"fb_access_token" json:"fb_access_token,omitempty"`
Created time.Time `datastore:"created" json:"-"`
}
And I perform a .GetAll to populate it:
// Skip a few steps here
var userProfiles []UserProfile
q.GetAll(c, &userProfiles)
Say I want to modify one of those entities:
userProfile[0].Email = "test@example.com"
I know I want to Put that entity like so:
k = datastore.Put(c, k, userProfile[0])
How do I get that initial key from userProfile[0] to call Put with?