forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "move compile time version information (elastic#6050)" (…
…elastic#6087)" This reverts commit b9fefe1.
- Loading branch information
1 parent
011adba
commit c5ef6fe
Showing
5 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
package version | ||
|
||
import "time" | ||
|
||
// GetDefaultVersion returns the current libbeat version. | ||
// This method is in a separate file as the version.go file is auto generated | ||
func GetDefaultVersion() string { | ||
return defaultBeatVersion | ||
} | ||
|
||
var ( | ||
buildTime = "unknown" | ||
commit = "unknown" | ||
) | ||
|
||
// BuildTime exposes the compile-time build time information. | ||
// It will represent the zero time instant if parsing fails. | ||
func BuildTime() time.Time { | ||
t, err := time.Parse(time.RFC3339, buildTime) | ||
if err != nil { | ||
return time.Time{} | ||
} | ||
return t | ||
} | ||
|
||
// Commit exposes the compile-time commit hash. | ||
func Commit() string { | ||
return commit | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.