Exercise: Adding and Validating Flags
Learn to enhance your Go-based CLI tool by adding a string flag for filtering port scan results with options 'all', 'open', or 'closed'. Understand how to implement input validation using Cobra's PreRunE function and update output behaviors accordingly. This exercise also encourages writing tests to ensure correctness.
We'll cover the following...
We'll cover the following...