1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/docs/025-version.md
Carlos Alexandro Becker f1a726b0cd
fixed build
2017-10-01 14:31:37 -03:00

425 B

title
main.version

GoReleaser always sets a main.version ldflag. You can use it in your main.go file:

package main

var version = "master"

func main() {
  println(version)
}

version will be set to the current Git tag (the v prefix is stripped) or the name of the snapshot, if you're using the --snapshot flag.

You can override this by changing the ldflags option in the build section.