Example Makefile for Go projects
Switch branches/tags
Nothing to show
Clone or download
Latest commit 09e03a6 Aug 20, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/hello-world Clean before start Aug 20, 2018
.env initial commit Aug 19, 2018
.gitignore initial commit Aug 19, 2018
Makefile Clean before start Aug 20, 2018
README.md Update README.md Aug 20, 2018
api.go initial commit Aug 19, 2018



Example project for the Makefile explained in A Good Makefile for Go blog post.


Run following commands to try it out:

It should now be running at :7777 (defined in .env file). You can try making a change and see how the server will get recompiled and restarted automatically.


Run make help to list available commands:

  λ  make help

 Choose a command run in go-makefile-example:

  install   Install missing dependencies. Runs `go get` internally. e.g; make install get=github.com/foo/bar
  start     Start in development mode. Auto-starts when code changes.
  stop      Stop development mode.
  watch     Run given command when code changes. e.g; make watch run="echo 'hey'"
  compile   Compile the binary.
  exec      Run given command, wrapped with custom GOPATH. e.g; make exec run="go test ./..."
  clean     Clean build files. Runs `go clean` internally.