mirror of
https://github.com/passbolt/go-passbolt-cli.git
synced 2025-05-12 02:58:20 +00:00
Get version info via ldflag during build time.
This commit is contained in:
parent
774fc8b54b
commit
3df7993ba0
1 changed files with 7 additions and 3 deletions
10
main.go
10
main.go
|
@ -1,13 +1,17 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/carlmjohnson/versioninfo"
|
||||
"github.com/passbolt/go-passbolt-cli/cmd"
|
||||
"time"
|
||||
)
|
||||
|
||||
// this variable is one of the goreleaser's default ldflag
|
||||
// which considers the latest git tag as version (the v prefix is stripped)
|
||||
// More info: https://goreleaser.com/cookbooks/using-main.version/
|
||||
var version string = "(devel)"
|
||||
|
||||
func main() {
|
||||
cmd.SetVersionInfo(versioninfo.Version, versioninfo.Revision, versioninfo.LastCommit.Format(time.RFC3339))
|
||||
cmd.SetVersionInfo(version, versioninfo.Revision, versioninfo.LastCommit.Format(time.RFC3339))
|
||||
cmd.Execute()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue