This is a template go repository with actions already set up to create compiled releases
- a basic cli application with subcommands based on Kong
- logging using zerolog
- some customisations like a more descriptive version info
- GitHub workflow to run tests on every push
- GitHub Workflow to build binary releases with goreleaser
- A sample for a spinner using spinner
- some sample code for a cli interactive selection dialogue using promptui
git clone https://github.com/gentoomaniac/go-template.git ./
rm -r .git
# goreleaser IDs and binary names
sed 's/template-application/my-new-application/g' .goreleaser.yaml
# go.mod
sed 's#gentoomaniac/go-template#githubuser/reponame#g' go.mod
git init
git add -A
git commit -m 'import template'
goreleaser build --single-target --snapshot
> template-application --help
Usage: template-application <command>
Flags:
-h, --help Show context-sensitive help.
-v, --verbosity=INT Increase verbosity.
-q, --quiet Do not run upgrades.
--json Log as json
--debug shortcut for -vvvv
Commands:
foo
FooBar command
Run "template-application <command> --help" for more information on a command.
> template-application -vvv
8:40PM INF Default command
> template-application -vvv --json foo
{"level":"info","time":"2021-11-05T20:41:33+01:00","message":"foo command"}
template-application -V
template-application commit:bf9d771 release:snapshot build:workflow/1 date:2021-11-05T19:58:00Z goVersion:go1.17.2 platform:linux/amd64