A powerful Golang CLI application scaffold integrated with Logrus, arg parser, toml config, testify, Makefile, VSCode and Github Action.
MIT License
A powerful Golang CLI application scaffold integrated with logrus, go-arg, config, testify and Github Action.
Click Use this template
button to create a new repository. Then clone the new repository to your local machine.
Change the package name
example.com/m
with your own package name.example.com/m
You can replace by sed
:sed -i 's/example.com\/m/your.package.name/g' $(find . -type f)
Or use global search and replace in your IDE.
Change the module name
greet
cmd/greet
to cmd/YOUR_APP_NAME
Makefile
for BIN_NAMES
conf/*.toml
for logger file namecmd/greet/app/conf.go
for Name
constasnt.vscode
for debuggingAdd more application if needed
cmd
folder just like greet
app.Makefile
for BIN_NAMES
, for example:BIN_NAMES=app1 app2
Enable write permission for workflow
Settings
tab of your repository.Action -> General
in left sidebar.Workflow permissions
section.Read and write permission
README.md
. Switch LICENSE
to your own license.make dev
to build for your local machine.make test
to run unit tests.make package
to cross compile for different platforms.Action
tab of your repository to see the Github Action workflow. In release workflow, click Run workflow
button to release your application.go run cmd/greet/main.go Jack -v -c ./dist/config.example.toml
--verbose
and --config
./dist/config.example.toml
Use | jq
to pretty print JSON log.
Generate structs for your config file: Toml to Go