1. Downloading goI had already done this a while back, but on a typical OS X dev machine, this is a one liner:
$ brew install go
2. Hello worldMartini was the project that pushed me over the edge to play around with go, so I went with their starter project:
Running this worked without any issues:
go get github.com/go-martini/martini
go run server.go
4. DeployingGetting GAE up and running was a bit more pain than I had hoped for:
1. Installation bash script:
$ curl https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash
2. I had to set up a new project and was assigned a project ID of platinum-trees-564 and a git repo. That's nice, I would prefer to use Github but I don't want to muck around too much with the process until I'm comfortable with it, so let's keep going with it. Oh it looks like there is a deploy script built in to the git server? Let's try that.
$ git push (...blah blah...) remote: Scanning pack: 100% (3/3), done. remote: Storing objects: 100% (3/3), done. remote: Processing commits: 100% (1/1), done. remote: Starting execution... =remote: Created deployment: platinum-trees-564.clouddev.gaeTemplate-d981b975f1ecaa6d.deployment_1398662263832 remote: Dispatched remote: Deployment '[email protected]@[email protected][email protected]' is in PENDING. remote: Scanning files on local disk. remote: Uploading 1 files. remote: Sending batch containing 1 file(s) totaling 0KB. remote: Cloning 2 application files. remote: Uploaded 1 files. remote: Initiating update. remote: Deploying new version. remote: Closing update: new version is ready to start serving. remote: Updated successfully remote: Deployment to App Engine successful. To https://source.developers.google.com/p/platinum-trees-564/r/default 611be7f..7b646ae master -> master
3. Nope, deploy didn't work. Logs say:
Request failed because the app binary was missing. This can generally be fixed by redeploying your app.
4. From this Go doc I try fixing up the app.yml file. No luck
5. Found this other doc that talks about running the GAE server locally.
Wat. Where did this goapp come from?
6. Going through the logs from step 3.1 (installation script), I find that I installed some things at ~/dev/google-cloud-sdk. It turns out I need to run ~/dev/google-cloud-sdk/platform/google_appengine/goapp. I could probably add this to my path, but it would be nice if this had been mentioned somewhere before.
7. GOTO step 5. Oops, goapp doesn't seem to like martini. This seems to be a problem with martini as it's trying to default to port 3000, and goapp wants it to use 8080. Screw it, let's go with even more barebone helloworld: