Hey, DEV friends! 👋 Today, I'd like to introduce a new version of my own project Create Go App CLI, that changes some fundamental things.
- A new way to install and update CLI
- Switch from my own realization for embed files to built-in feature in Go 1.16.x
- Switch from Taskfile.yml to simple
- Add support for Apple Silicon CPUs
v1.7.0, I dropped support Golang versions
1.15.x. A minimal Go version for build CLI from a source is now
1.16.x (and higher). Therefore, old way to install by
go build -i ... command isn't relevant.
Please, use this command to install or update to a latest version:
go install -ldflags="-s -w" github.com/create-go-app/cli@latest
Next, just rename binary, like this:
mv $GOPATH/bin/cli $GOPATH/bin/cgapp
Also, macOS and GNU/Linux users available way to install via Homebrew:
# Tap a new formula: brew tap create-go-app/cli # Installation: brew install create-go-app/cli/cgapp
You can do it by using a version suffix in
go install command:
# With an indication of the exact versions: go install email@example.com
Don't forget to rename binary after installation, according to the version you have installed! This must be done to avoid confusion with the latest version.
mv $GOPATH/bin/cli $GOPATH/bin/cgapp_v1_6_0
And run it by
☝️ Found all available CLI versions on pkg.go.dev page.
- TODO: Add version for Snapcraft (for GNU/Linux users).
- TODO: Add version for Scoop (for MS Windows users).
It would be great to read in the comments about what other installation method would be convenient for you! 😌
Previously, to implement embedded configuration files, I used this method I described in this article in great detail:
But, a new package embed in Golang
1.16.x standard library, can do it natively, with a maximum smooth and fully DX (developer experience). So, personally, I was very much looking forward to this opportunity and immediately took advantage of it!
Yes, I thought I could replace the good old
Makefile with some modern solution for automating commonly used commands for a project... but I was wrong! So, I made the willful decision to go back to the roots.
In this version (and later), support for Taskfile will be dropped throughout the Create Go App project (both in the CLI and in production-ready templates).
make runnot a
I say "thank you" to the developers of this tool, but habit is much stronger! 😉
Now, in assets of every release (at GitHub repository), I put special binary version for beautiful working Create Go App CLI on the Mac computers with Apple-designed processors (
M1 and higher).
Wikipedia: The M1 chip, Apple's first processor designed for use in Macs, is manufactured using TSMC's 5 nm process. It was announced on November 10, 2020, and is used in the M1 MacBook Air, Mac mini, and MacBook Pro (2020).
- Tim Mossholder https://unsplash.com/photos/H6eaxcGNQbU
If you want more articles like this on this blog, then post a comment below and subscribe to me. Thanks! 😘
And, of course, you can support me by donating at LiberaPay. Each donation will be used to write new articles and develop non-profit open-source projects for the community.