Skip to content

Commit 4edaed4

Browse files
terminal: add commit_hash to --version output
The `commit_hash` field will contain the full commit hash of the commit that build was based on.
1 parent e30ac3d commit 4edaed4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

version.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ func Version() string {
4848
}
4949

5050
// RichVersion returns the application version as a properly formed string
51-
// per the semantic versioning 2.0.0 spec (http://semver.org/), the git tag it
52-
// was built on.
51+
// per the semantic versioning 2.0.0 spec (http://semver.org/), the git tag and
52+
// commit hash it was built on.
5353
func RichVersion() string {
54-
// Append git tag of current build to version.
54+
// Append git tag and commit hash of current build to version.
5555
return fmt.Sprintf(
56-
"%s commit=%s", semanticVersion(), Commit,
56+
"%s commit=%s commit_hash=%s", semanticVersion(), Commit,
57+
CommitHash,
5758
)
5859
}
5960

0 commit comments

Comments
 (0)