Here is a screen shot of the entities I'm trying to read.
Here is my go code:
package readfromgcd
import (
"net/http"
"appengine"
"appengine/datastore"
"fmt"
)
type person struct {
firstname string
lastname string
}
func init () {
http.HandleFunc("/", readpeople)
}
func readpeople (w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
q := datastore.NewQuery("person")
people := make([]person, 0, 20)
if _, err := q.GetAll(c, &people); err !=nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
fmt.Fprint(w, "Hello world!")
}
I get the following result: datastore: cannot load field "firstName" into a "readpeople.person": no such struct field
Here is a screenshot. result
This code does not show doing anything with this data. I wanted to limit this post to the retrieval. I must be missing something simple. Where have I gone wrong? Thanks in advance for any help.