This is why I started, somewhat as a challenge, trying to create a CLI that would generate a series of random bytes in base64, using GoLang and cobra.
As I developed this little CLI I came up with other features that I have implemented, or that I have noted at the time.
It was an excellent test bed for some aspects that I had never tried to implement or that I had never investigated.
I called the tool SDT: Smart Developer Tools and the repository is located here.
What have I learned?
- Create a cli in golang using cobra 🐍 and create related unit tests
- Manage parameters from files using viper
- Input management from different sources (Stdin, file, command line arguments)
- Management of different types of output
- Use of Go 1.18 generics!
- Multi-architecture build and release using goreleaser
- Use of UPX for the compression of the generated binary files
- Split architecture optimized code (wasm)
- Creation of a web app based on WebAssembly
- Use of Vite for the creation of web apps based on Lit
- Using Fyne to create a desktop GUI (work in progess)
- Deploy of hybrid application golang + typescript with Netlify (first demo here)
I hope that this tool becomes useful and does not remain just a test bed, I have already been able to use it successfully in daily work.