Implementing Application I/O

Learn application I/O by understanding flags and handling basic flag errors.

CLI applications require a way to understand how we want them to execute. This might include what files to read, what servers to contact, and what credentials to use. There are a couple of ways to start an application with the parameters it requires:

  • Using the flag package to define command-line flags.

  • Using os.Args to read arguments that are not defined.

Get hands-on with 1400+ tech skills courses.