Next: Exercise 1.3, Previous: Exercise 1.1, Up: Exercises [Index]
Modify the echo
program to print the index and value of each of its arguments,
one per line.
// Echo the command-line arguments, and print the index and value of each argument // on a separate line package main import ( "fmt" "os" ) func main() { for index, value := range os.Args[0:] { fmt.Println(index, value) } }