Skip to content

Commit

Permalink
feat(influxdb): Add global BuildInfo
Browse files Browse the repository at this point in the history
Permits binary packages to set a global BuildInfo state that
can be inspected by other packages
  • Loading branch information
stuartcarnie committed Mar 14, 2019
1 parent 0d04563 commit f5c54a0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,17 @@ type BuildInfo struct {
Commit string // Commit is the current git commit SHA
Date string // Date is the build date in RFC3339
}

var buildInfo BuildInfo

// SetBuildInfo sets the build information for the binary.
func SetBuildInfo(version, commit, date string) {
buildInfo.Version = version
buildInfo.Commit = commit
buildInfo.Date = date
}

// GetBuildInfo returns the current build information for the binary.
func GetBuildInfo() BuildInfo {
return buildInfo
}

0 comments on commit f5c54a0

Please sign in to comment.