We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 42d8fdf commit 6596ab0Copy full SHA for 6596ab0
1 file changed
intra/core/version.go
@@ -11,6 +11,7 @@ import (
11
"fmt"
12
"runtime"
13
"runtime/debug"
14
+ "strings"
15
)
16
17
var buildinfo, _ = debug.ReadBuildInfo()
@@ -27,11 +28,15 @@ func Version() string {
27
28
}
29
30
func stamp() string {
- if buildinfo != nil {
31
- // github.com/golang/go/issues/50603
32
- return buildinfo.Main.Path + "@v" + buildinfo.Main.Version
+ path := ""
+ v := "v" + Date + "-" + Commit
33
+ if buildinfo != nil { // github.com/golang/go/issues/50603
34
+ path = buildinfo.Main.Path + "@"
35
+ if len(buildinfo.Main.Version) > 0 && !strings.Contains(buildinfo.Main.Version, "devel") {
36
+ v = "v" + buildinfo.Main.Version
37
+ }
38
- return "v" + Date + "-" + Commit
39
+ return path + v
40
41
42
func BuildInfo() string {
0 commit comments