Go (cookiecutter-go)

Use the cookiecutter-go template to scaffold a new golang project.

Repository https://bitbucket.org/greenguavalabs/cookiecutter-go
Pre-requisites Local install:
make
Docker and Docker Compose

Usage

Install cookiecutter command line:


pip install cookiecutter

Switch to a project folder and generate the `cookiecutter` template:


cookiecutter bb:greenguavalabs/cookiecutter-go.git

Features

Development environment

The cookiecutter-go template generates a Docker based development environment for golang projects. The following make tasks are available to operate the development environment.

Manage the development environment:

* make init – Bring up the docker container
* make clean – Stop and remove docker container

Verify and test project code:

* make bins – Build all project binaries
* make lint – Run lint tools on all project files
* make test – Run all project test

CLI

The template provides you the option to generate golang packages for building a command line app using the github.com/spf13/cobra framework.

To generate the cli packages chose 1 at the prompt below:


Select cli:
1 - yes
2 - no
Choose from 1, 2 [1]: