You've already forked goreleaser
mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-11-23 22:36:11 +02:00
feat: add more info to --version
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
This commit is contained in:
2
main.go
2
main.go
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
|
||||
"github.com/goreleaser/goreleaser/cmd"
|
||||
@@ -37,6 +38,7 @@ func buildVersion(version, commit, date, builtBy string) string {
|
||||
if builtBy != "" {
|
||||
result = fmt.Sprintf("%s\nbuilt by: %s", result, builtBy)
|
||||
}
|
||||
result = fmt.Sprintf("%s\ngoos: %s\ngoarch: %s", result, runtime.GOOS, runtime.GOARCH)
|
||||
if info, ok := debug.ReadBuildInfo(); ok && info.Main.Sum != "" {
|
||||
result = fmt.Sprintf("%s\nmodule version: %s, checksum: %s", result, info.Main.Version, info.Main.Sum)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user