Wrapping Up
In this chapter, you designed and built a flexible tool that uses other tools and commands to execute specialized tasks in an automated way. You executed external commands, managed their error conditions, captured their output, and handled long-running processes appropriately. You tested your application using two different strategies: using a test helper to build a temporary local infrastructure, and mocking the external command. Finally, you ensured your application handles the operating system signal in a clean way to correctly communicate status to downstream applications and to prevent data loss.
In the next chapter, you’ll use the Cobra CLI framework to help you develop a command-line network port scanner by generating the boilerplate ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access