Template for building command-line interfaces in golang.
This repo is intended to be used as a template for building go-based command-line interfaces.
See the github docs For more info.
After generating a new project or repo from this template, some customization will be required. These items include:
TEMPLATE_TODO
- To aid in identifying and locating these items, comments including the wordsTEMPLATE_TODO
have been added to the codebase. Using your editor of choice, search/grep for this tag and make adjustments as indicated by comments at those locations. These comments can then be deleted if desired.README.md
- Requires customization, including removal of this section and the main heading.go.mod
andgo.sum
- go modules are used for denpendency management. Delete the existinggo.*
files and rungo mod init
andgo mod tidy
.
This project follows semantic versioning.
When it's time to create a new release version:
-
make git/changes
to review changes since the last release. Based on the changes, decide what kind of release is required (bugfix, feature or breaking). -
BUMP=(major|minor|patch|bugfix|feature|breaking) make git/tag
to create a new git tag. (bugfix, feature and breaking are aliases for semver's patch, minor and major). BUMP defaults to patch. The command assumes you have a remote repository namedorigin
pointing to this repository. If you'd prefer to specify a different remote repository, you can do so by settingORIGIN=(preferred remote name)
. -
make github/release
to create a new release based on the most recent git tag. This step will build application binaries for each os and architecture, docker images based on the binary, upload the images to a docker registry and the binaries to the github release.
- goreleaser
- docker
GITHUB_TOKEN
defined in.env.goreleaser
withrepo
access.