Skip to content

Instantly share code, notes, and snippets.

@techtonik
Last active September 17, 2016 00:34
Show Gist options
  • Save techtonik/98ff54ef262f88bf98f29b0cd41890d8 to your computer and use it in GitHub Desktop.
Save techtonik/98ff54ef262f88bf98f29b0cd41890d8 to your computer and use it in GitHub Desktop.
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