Skip to content

Instantly share code, notes, and snippets.

@austindoeswork
Created February 20, 2017 19:19
Show Gist options
  • Save austindoeswork/97a71f1bce8d3a748b2f55cb61666885 to your computer and use it in GitHub Desktop.
Save austindoeswork/97a71f1bce8d3a748b2f55cb61666885 to your computer and use it in GitHub Desktop.
package main
import (
"flag"
)
var (
commithash string
versionFlag = flag.Bool("v", false, "git commit hash")
)
func main() {
flag.Parse()
if *versionFlag {
fmt.Println(commithash)
return
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment