A general purpose golang CLI template for Github and Gitlab
View the Project on GitHub FalcoSuessgott/golang-cli-template
deb.
and .rpm
packer and container (docker.hub
and ghcr.io
) releasing including manpages
and shell completions
and grouped Changelog generation.windows
, linux
, mac-os
), Build, Release)README.md
badgestools/
=> for automatically shipping all required dependencies when running go get
(or make bootstrap
) such as golang-ci-lint
(see: https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module)
)scripts/
=> build scriptsbash <(curl -s https://raw.githubusercontent.com/FalcoSuessgott/golang-cli-template/master/install.sh)
In order to make the CI work you will need to have the following Secrets in your repository defined:
Repository -> Settings -> Secrets & variables -> CODECOV_TOKEN
, DOCKERHUB_TOKEN
& DOCKERHUB_USERNAME
$> golang-cli-template -h
golang-cli project template demo application
Usage:
golang-cli-template [flags]
golang-cli-template [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
example example subcommand which adds or multiplies two given integers
help Help about any command
version golang-cli-template version
Flags:
-h, --help help for golang-cli-template
Use "golang-cli-template [command] --help" for more information about a command.
$> golang-cli-template example 2 5 --add
7
$> golang-cli-template example 2 5 --multiply
10
$> make
bootstrap install build deps
build build golang binary
clean clean up environment
cover display test coverage
docker-build dockerize golang application
fmt format go files
help list makefile targets
install install golang binary
lint lint go files
pre-commit run pre-commit hooks
run run the app
test display test coverage
If you find issues in that setup or have some nice features / improvements, I would welcome an issue or a PR :)