Files
sjy01-image-proc/cmd/version.go
2024-10-29 16:30:02 +08:00

51 lines
1.3 KiB
Go

package main
import "fmt"
// 版本信息
var (
// BuildDate date string of when build was performed filled in by -X compile flag
BuildDate string
// LatestCommit date string of when build was performed filled in by -X compile flag
LatestCommit string
// BuildNumber date string of when build was performed filled in by -X compile flag
BuildNumber string
// BuiltOnIP date string of when build was performed filled in by -X compile flag
BuiltOnIP string
// BuiltOnOs date string of when build was performed filled in by -X compile flag
BuiltOnOs string
// RuntimeVer date string of when build was performed filled in by -X compile flag
RuntimeVer string
// Branch git branch
Branch string
// CommitCnt ...
CommitCnt string
// Version
ShowVersion bool
)
const (
Version = "v1.2.0-beta"
)
func version() string {
v := fmt.Sprintf(`
Main Version: %s
---------------------------------------------------------
BUILT_ON_IP %s
BUILT_ON_OS %s
DATE %s
LATEST_COMMIT %s
BRANCH %s
COMMIT_CNT %s
BUILD_NUMBER %s
RUNTIME_VER %s
OpenCV Version 4.9.0
GDAL Version 3.8.4
---------------------------------------------------------
`, Version, BuiltOnIP, BuiltOnOs, BuildDate, LatestCommit, Branch, CommitCnt, BuildNumber, RuntimeVer)
return v
}