Читать книгу Practical Go - Amit Saha - Страница 49
Summary
ОглавлениеWe started off the chapter implementing a basic command-line interface by directly parsing the command-line arguments. You then saw how you can make use of the flag
package to define a standard command-line interface. Instead of implementing the parsing and validating the arguments ourselves, you learned to use the package's built-in support for user-specified arguments and data type validation. All throughout the chapter, you wrote well-encapsulated functions to make unit testing straightforward.
In the next chapter, you will continue your journey into the flag
package by learning to implement command-line applications with sub-commands, introducing robustness into your applications and more.