Exercises
Powerful Command-Line Applications in Go — by Ricardo Gerardi (70 / 127)
Published in
1 min readMar 23, 2022
👈 Handling Signals | TOC | Wrapping Up 👉
Try these exercises to improve the skills you learned:
- Add another step to the pipeline: code linting using golangci-lint. For more information consult its home page.[38]
- Add gocyclo to the pipeline. Capture its output and return an error if gocyclo returns any functions with a complexity score of 10 or greater. For more information about this tool, consult its GitHub page.[39]
- Add environment variables to handle Git authentication with remote repositories that require it.
- Add another command-line flag to your tool asking for the Git branch to push. Update the Git step to accept a configurable branch instead of master.
- Get the Pipeline configuration from a file instead of hard-coding it in the run function.
👈 Handling Signals | TOC | Wrapping Up 👉
Powerful Command-Line Applications in Go by Ricardo Gerardi can be purchased in other book formats directly from the Pragmatic Programmers. If you notice a code error or formatting mistake, please let us know here so that we can fix it.