- Commandline argument in go are available via
os
package. In OS package, we have variable called asArgs
. os.Args
is of slice typeos.Args[0]
is the name of the command.- from os.Args[1] to os.Args[len(os.Args)] will iterate over all the command line arguments that passed as input to the go program.