Go Lang Notes


Filesystem

Packages

How to collect passed flags/parameters/arguments to the GO program

  1. import the flag Package ie. import "flag"
  2. use the flag.Arg function to get the non-flag arguments in the form of a string ie. firstArgument := flag.Arg(0)
  3. use the flag.Parse() to flags (have a dash) like: -d