Skip to content

Instantly share code, notes, and snippets.

@atotto
Created August 22, 2013 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atotto/6306293 to your computer and use it in GitHub Desktop.
Save atotto/6306293 to your computer and use it in GitHub Desktop.
// You can define a version string using -ldflags and -X options.
// $ go run -ldflags "-X main.version 0.1" version.go
//
package main
import (
"fmt"
)
var version string
func main() {
fmt.Println(version)
// Output:
// 0.1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment