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:], " "))
}
Listing 1.11: Ch1 Exercise 1.1