A general purpose project template for golang CLI applications
This template serves as a starting point for golang commandline applications based on the go community default project-layout.
- goreleaser with
deb.
and.rpm
package releasing - golangci-lint for linting and formatting
- Golang Github Actions Stages (Linting, Testing, Releasing)
- Gitlab CI Configuration (Linting, Testing, Releasing)
- tested cobra setup
- Makefile - with various useful targets (see Makefile Targets)
- assets/ => docs, images, etc
- cmd/ => commandline configurartions (flags, subcommands)
- pkg/ => packages that are okay to import for other projects
- internal/ => packages that are only for project internal purposes
$> golang-cli-template
golang-cli project template demo application
Usage:
golang-cli-template [flags]
golang-cli-template [command]
Available Commands:
example example subcommand which adds or multiplies two given integers
help Help about any command
version Displays d4sva binary version
Flags:
-h, --help help for golang-cli-template
Use "golang-cli-template [command] --help" for more information about a command.
$> golang-cli-template 2 5 --add
7
$> golang-cli-template 2 5 --multiply
10
make lint
make fmt
make fmtcheck
make build
make test
make cover