1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

document main.version ldflags

closes #16
This commit is contained in:
Carlos Alexandro Becker 2017-01-11 20:10:02 -02:00
parent 3962989f0e
commit 87c5d8651b
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -107,6 +107,23 @@ files:
> By default GoReleaser adds the binary itself, `LICENCE*`, `LICENSE*`,
`README*` and `CHANGELOG*`.
### ldflags
GoReleaser already sets a `main.version` ldflag, so, in you `main.go` program,
you can:
```go
package main
var version = "master"
func main() {
println(version)
}
```
And this version will always be the tag name.
## Wire it with travis-ci
You may want to wire this to auto-deploy your new tags on travis, for example: