Documentation ¶
Overview ¶
Package version
@author: xwc1125
Index ¶
Constants ¶
View Source
const (
// VersionMeta_Stable 稳定版本
VersionMeta_Stable = "stable"
)
Variables ¶
View Source
var ( FilePath string = "./" // Version 版本号 Version string // VersionMeta :"stable","beta","alpha" // 如果为stable,那么返回主版本:0.0.1 // 否则,那么返回子版本:0.0.1.1 VersionMeta string // BuildTime 编译时间 BuildTime string // GitHash 当前的Git Hash码 GitHash string // GitDate 当前的Git 提交时间 GitDate string // BuildNumber 编译次数 BuildNumber string )
View Source
var ArchiveVersion = func() string { vsn := GetVersion() if VersionMeta != "" { vsn += "-" + VersionMeta } if len(GitHash) >= 8 { vsn += "-" + GitHash[:8] } return vsn }
ArchiveVersion 归档版本号:带commit
View Source
var VersionWithCommit = func() string { vsn := VersionWithMeta() if len(GitHash) >= 8 { vsn += "-" + GitHash[:8] } if GitDate != "" { vsn += "-" + GitDate } return vsn }
VersionWithCommit 带commit的版本
View Source
var VersionWithMeta = func() string { v := GetVersion() if VersionMeta != "" { v += "-" + VersionMeta } return v }
VersionWithMeta 带meta的版本号
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.