github.com/neatio-net/neatio@v1.7.3-0.20231114194659-f4d7a2226baa/params/version.go (about) 1 package params 2 3 import ( 4 "fmt" 5 ) 6 7 const ( 8 VersionMajor = 3 9 VersionMinor = 3 10 VersionPatch = 4 11 VersionMeta = "unstable" 12 ) 13 14 var Version = func() string { 15 return fmt.Sprintf("%d.%d.%d", VersionMajor, VersionMinor, VersionPatch) 16 }() 17 18 var VersionWithMeta = func() string { 19 v := Version 20 if VersionMeta != "" { 21 v += "-" + VersionMeta 22 } 23 return v 24 }() 25 26 func VersionWithCommit(gitCommit string) string { 27 vsn := Version 28 if len(gitCommit) >= 8 { 29 vsn += "-" + gitCommit[:8] 30 } 31 return vsn 32 }