Skip to content

Commit

Permalink
Emit commit and build date
Browse files Browse the repository at this point in the history
  • Loading branch information
nakabonne committed May 13, 2020
1 parent f1ef10f commit 2e5ac64
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ var (
}
// Automatically populated by goreleaser during build
version = "unversioned"
commit = ""
date = ""
commit = "?"
date = "?"
)

type cli struct {
Expand Down Expand Up @@ -57,7 +57,7 @@ func main() {

func (c *cli) run() int {
if c.versionFlag {
fmt.Fprintf(c.stderr, "version=%s, os=%s, arch=%s\n", version, runtime.GOOS, runtime.GOARCH)
fmt.Fprintf(c.stderr, "version=%s, commit=%s, buildDate=%s, os=%s, arch=%s\n", version, commit, date, runtime.GOOS, runtime.GOARCH)
return 0
}

Expand Down

0 comments on commit 2e5ac64

Please sign in to comment.