os.Args provides access to raw command-line arguments.
Note that the first value in this slice is the path to the program, and os.Args[1:] holds the arguments to the program.
You can get individual args with normal indexing.
To experiment with command-line arguments run 'go run cli.go parameter-1 parameter 2'
[ parameter-1 parameter 2]
parameter-1
Top comments (0)