// Chapter 32 example: the words typed after the program name, in os.Args. // Run with: go run exercises/32/01-args.go hello "two words" 42 package main import ( "fmt" "os" "path/filepath" ) func main() { fmt.Println("Program:", filepath.Base(os.Args[0])) fmt.Println("Arguments:", len(os.Args)-1) for i, arg := range os.Args[1:] { fmt.Printf("%d: %s\n", i+1, arg) } }