package test
import (
"net/http"
"google.golang.org/appengine"
"google.golang.org/appengine/datastore"
)
func init() {
http.HandleFunc("/", handler)
}
type myStruct struct {
test string
}
func handler(w http.ResponseWriter, r *http.Request) {
var ctx = appengine.NewContext(r)
datastore.Put(ctx, datastore.NewKey(ctx, "myStruct", "mykey", 0, nil), &myStruct{ test: "foo" } )
}
The above code will store the entity and its key name in the Datastore, but it does not store the property value "foo" unless I capitalize the property name to "Test". I thought upper case is not necessary when a variable is in the same package? I'm using the local development server.