The documentation I used (https://developers.google.com/appengine/docs/go/datastore/reference#hdr-The_PropertyLoadSaver_Interface)
Just using this struct without using the propertyLoadSaver everything works.
type Trick struct {
Name string `json:"name" datastore:"-"`
Difficulty int `json:"difficulty"`
}
When only using a load property it also works.
func (s *Trick) Load(c <-chan datastore.Property) error {
return datastore.LoadStruct(s, c)
}
The save property results into a appengine panic at the return line?
func (s *Trick) Save(c chan<- datastore.Property) error {
defer close(c)
return datastore.SaveStruct(s, c)
}
When I try this instead it will not result into a panic but does not save anything?
func (s *Trick) Save(c chan<- datastore.Property) error {
defer close(c)
c <- datastore.Property{
Name: "Difficulty",
Value: s.Difficulty,
}
return nil
}
(Using sdk v1.9.8)