Next: Exercise 1.2, Up: Exercises [Index]
Modify the echo
program to also print os.Args[0]
, the name of the command
that invoked it.
// Echo the name of the command that invokes this package. package main import ( "fmt" "os" "strings" ) func main() { fmt.Println(strings.Join(os.Args[0:], " ")) }