Examples showing options for managing GOPATHs when developing with a Go App Engine projects.
APACHE-2.0 License
I wrote this repository, because every time I went to start a new Go project on Google App Engine I couldn't remember an optimal way to structure my application and how to manage my GOPATH in relation to my application code.
This repository aims to show several options for managing GOPATHs when working with a Go App Engine projects.
It assumes that you already have the Google Cloud Platform SDK installed.
If you have a different way that you feel is appropriate, pull requests are more than welcome.
It should be noted that while this repository makes relatively heavy use of Make, you only need to be able to run Make commands, not understand the files (but it is a useful thing to know!)
For a full description of what this repository is showing read the full blog post.
Except for the GB tasks, the GOPATH is controlled within the Makefiles that are in this project. This means you can run any of the Make tasks in this project to test them out, without having to change a GOPATH you already have set.
git clone https://github.com/markmandel/appengine-golang-gopath.git
cd appengine-golang-gopath
make install-tools
cd src/modules/basic
routes.go
file to see what is being executed: cat routes.go
make debug-env
make deps
(cd ../.. && pwd && ls)
make serve
make deploy
Makefile
and Makefile.goapp
to see how the steps worked: cat Makefile
and cat ../../../Makefile.goapp
cd ../vendored
make clean
routes.go
file to see what is being executed: cat routes.go
make debug-env
. Notice the two part GOPATH.make deps
(cd ../../../vendor/src && pwd && ls)
make serve
make deploy
Makefile.goapp
to see how the steps worked: cat ../../../Makefile.goapp
cd ../gb
make clean
routes.go
file to see what is being executed: cat routes.go
make debug-env
. Notice there is no GOPATH. Crazy.make deps
(cd ../../../vendor/src && pwd && ls)
manifest
file: cat ../../../vendor/manifest
.make serve
make deploy
Makefile
and Makefile.gb
to see how the steps worked: cat Makefile
and cat ../../../Makefile.gb
Apache 2.0
This is not an official Google product.