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
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 help me make developers' lives even better! Just connect to one of my projects as a contributor. It's easy!
My projects that need your help (and stars) 👇
- 🔥 gowebly: A next-generation CLI tool for easily build amazing web applications with Go on the backend, using htmx & hyperscript and the most popular atomic/utility-first CSS frameworks on the frontend.
- ✨ create-go-app: Create a new production-ready project with Go backend, frontend and deploy automation by running one CLI command.
- 🏃 yatr: Yet Another Task Runner allows you to organize and automate your routine operations that you normally do in Makefile (or else) for each project.
- 📚 gosl: The Go Snippet Library provides snippets collection for working with routine operations in your Go programs with a super user-friendly API and the most efficient performance.
- 🏄♂️ csv2api: The parser reads the CSV file with the raw data, filters the records, identifies fields to be changed, and sends a request to update the data to the specified endpoint of your REST API.
- 🚴 json2csv: The parser can read given folder with JSON files, filtering and qualifying input data with intent & stop words dictionaries and save results to CSV files by given chunk size.