forked from celestiaorg/celestia-node
-
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.
chore: move versioning outside the main package (celestiaorg#2468)
- Loading branch information
Showing
8 changed files
with
41 additions
and
37 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
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,9 +1,35 @@ | ||
package node | ||
|
||
// BuildInfo stores all necessary information for the current build. | ||
import ( | ||
"fmt" | ||
"runtime" | ||
) | ||
|
||
var ( | ||
buildTime string | ||
lastCommit string | ||
semanticVersion string | ||
|
||
systemVersion = fmt.Sprintf("%s/%s", runtime.GOARCH, runtime.GOOS) | ||
golangVersion = runtime.Version() | ||
) | ||
|
||
// BuildInfo represents all necessary information about current build. | ||
type BuildInfo struct { | ||
BuildTime string | ||
LastCommit string | ||
SemanticVersion string | ||
SystemVersion string | ||
GolangVersion string | ||
} | ||
|
||
// GetBuildInfo returns information about current build. | ||
func GetBuildInfo() *BuildInfo { | ||
return &BuildInfo{ | ||
buildTime, | ||
lastCommit, | ||
semanticVersion, | ||
systemVersion, | ||
golangVersion, | ||
} | ||
} |
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