Merge PR #3620: Indicate build flags in version
This commit is contained in:
+9
-3
@@ -11,12 +11,14 @@ var (
|
||||
Commit = ""
|
||||
Version = ""
|
||||
VendorDirHash = ""
|
||||
BuildTags = ""
|
||||
)
|
||||
|
||||
type versionInfo struct {
|
||||
CosmosSDK string `json:"cosmos_sdk"`
|
||||
GitCommit string `json:"commit"`
|
||||
VendorDirHash string `json:"vendor_hash"`
|
||||
BuildTags string `json:"build_tags"`
|
||||
GoVersion string `json:"go"`
|
||||
}
|
||||
|
||||
@@ -24,11 +26,15 @@ func (v versionInfo) String() string {
|
||||
return fmt.Sprintf(`cosmos-sdk: %s
|
||||
git commit: %s
|
||||
vendor hash: %s
|
||||
%s`, v.CosmosSDK, v.GitCommit, v.VendorDirHash, v.GoVersion)
|
||||
build tags: %s
|
||||
%s`, v.CosmosSDK, v.GitCommit, v.VendorDirHash, v.BuildTags, v.GoVersion)
|
||||
}
|
||||
|
||||
func newVersionInfo() versionInfo {
|
||||
return versionInfo{
|
||||
Version, Commit, VendorDirHash, fmt.Sprintf("go version %s %s/%s\n",
|
||||
runtime.Version(), runtime.GOOS, runtime.GOARCH)}
|
||||
Version,
|
||||
Commit,
|
||||
VendorDirHash,
|
||||
BuildTags,
|
||||
fmt.Sprintf("go version %s %s/%s\n", runtime.Version(), runtime.GOOS, runtime.GOARCH)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user