So this will break the loop if e == datastore.ErrNoSuchEntity.
This fi.Value is going to be 0 because it didn't get a value set to it.
also, https://developers.google.com/appengine/docs/go/datastore/reference#Get
There are more error types you should be handling.
--
=====================
http://jessta.id.au
Even before you deploy, the appengine/datastore package is designed
only to be run by dev_appserver.py, if run on your local machine. To
repeat: you should not be using "go build" at all, for Go on App
Engine.
It's not clear to me how you're running your program, but if you're
not using the datastore as intended, then I can't help you on why your
program doesn't work.
First, you're now ignoring your errors again. Please print any error
(possibly nil) that you get. Do something like
fmt.Fprintf(w, "v=%v, err=%v\n", v, e)
> w.Write([]byte(v.Value+"\n"))
Second, this won't compile. v.Value is an int, and you can't add a
string to an int. If you're going to paste some code, please paste the
actual code that you use.
> %dev_appserver.py
> access http://xxx.appspot.com/ from browser
Third, when running dev_appserver.py, you need to browse to
http://localhost:8080/, not http://xxx.appspot.com/.