Skip to content

Instantly share code, notes, and snippets.

@luismoramedina
Created July 22, 2016 21:58
Show Gist options
  • Save luismoramedina/b398350aabfcada0f830a067985e1977 to your computer and use it in GitHub Desktop.
Save luismoramedina/b398350aabfcada0f830a067985e1977 to your computer and use it in GitHub Desktop.
go command line
package main
import (
"flag"
"fmt"
)
func main() {
var cmd string
var i bool
flag.StringVar(&cmd, "cmd", cmd, `cmd`)
flag.BoolVar(&i, "i", i, `i bool`)
flag.Parse()
fmt.Println(i)
fmt.Println(flag.Args())
fmt.Println(cmd)
flag.Usage()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment