Skeleton is a bare bones starter pack for new golang projects. It includes the following features:
- Skeleton main.go with command line parsing and version support
- Basic tests to show the way
- Support for:
- Makefile's for:
- Running tests
- Building - native and cross compilation
- Managing go dependencies (through govendor)
- Docker image generation and registry push
- Docker debugging (shell and attach)
- Sensible .gitignore and .dockerignore
- Checkout this repo into a new directory
cd /tmp
git clone https://github.com/ashmckenzie/go-skeleton new-app
-
Remove the .git directory to ensure no history from go-skeleton is retained
-
Edit
.envrc
and replace any<CHANGE-ME-XXX>
as required -
Either setup direnv to work with your shell, or if not, run
source .envrc
- Ensure govendor is installed
cd app
make install_govendor
- Run
make
in either
- The root directory to create a Docker image
- The app directory to compile as
./bin/<project_name>
- Enjoy :)
- https://tour.golang.org/welcome/1
- http://gobyexample.com
- https://www.golang-book.com/books/intro
- https://www.golang-book.com/books/intro/12
- https://github.com/kardianos/govendor
- https://nathanleclaire.com/blog/2014/02/15/how-to-wait-for-all-goroutines-to-finish-executing-before-continuing/
- https://nathanleclaire.com/blog/2015/03/09/youre-not-using-this-enough-part-one-go-interfaces/