Skip to content

Instantly share code, notes, and snippets.

@techtonik
Last active September 17, 2016 00:34
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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