Using the AppEngine 1.9.40 SDK, I can't even import the "appengine" package.
app.yaml:
application: testapp
version: 1
runtime: go
api_version: go1
handlers:
- url: /.*
script: _go_app
Go code:
package main
import (
"google.golang.org/appengine"
)
func init() {
appengine.IsDevAppServer()
}
func main() {
// This is only here because go-get needs on it.
}
Command-line:
$ GOPATH=$(pwd) goapp serve
Error:
2016/08/01 23:58:02 go-app-builder: Failed parsing input: parser: bad import "unsafe" in src/golang.org/x/net/icmp/helper.go
What can be done to get past this?
All code in the application directory tree (the root is the directory containing app.yaml) is compiled in to the app. Appengine rejects code that uses "unsafe".
The fix is to move the offending code out of the application directory tree. Here's one possible way to arrange the code:
It's also possible that using package
main
will cause some trouble. If the above does not work, change the package name.Appengine apps are not go-gettable. Don't struggle to make them so.
There's more discussion on this topic at https://github.com/golang/gddo/issues/428.