Create a gist now

Instantly share code, notes, and snippets.

@techtonik /argi.go
Last active Sep 17, 2016

Go - show program name and arguments
// go run argi.go
package main
import "os"
import "fmt"
func main() {
fmt.Println("prog:", os.Args[0])
if len(os.Args) > 1 {
fmt.Println("args:", os.Args[1:])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment