Files
  • main.go
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// :run go run $file -echo echo-arg additional arg
// no playground
package main

import (
	"fmt"
	"os"
)

// :show start
func main() {
	fmt.Printf("Name of executable: '%s'\n", os.Args[0])
	args := os.Args[1:]
	for i, arg := range args {
		fmt.Printf("Arg %d, value: '%s'\n", i, arg)
	}
}

// :show end
go version go1.9.4 linux/amd64