MCPcopy Index your code
hub / github.com/moonD4rk/HackBrowserData / resolveVersionFromBuildInfo

Function resolveVersionFromBuildInfo

cmd/hack-browser-data/version.go:28–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26}
27
28func resolveVersionFromBuildInfo() {
29 if version != "dev" {
30 return
31 }
32 info, ok := debug.ReadBuildInfo()
33 if !ok {
34 return
35 }
36 if info.Main.Version != "" && info.Main.Version != "(devel)" {
37 version = info.Main.Version
38 }
39 for _, s := range info.Settings {
40 switch s.Key {
41 case "vcs.revision":
42 if len(s.Value) > 8 {
43 commit = s.Value[:8]
44 } else if s.Value != "" {
45 commit = s.Value
46 }
47 case "vcs.time":
48 if s.Value != "" {
49 buildDate = s.Value
50 }
51 }
52 }
53}

Callers 1

versionCmdFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected