Files
origin/util/buildtime/build.go
2024-04-09 16:40:13 +08:00

21 lines
592 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package buildtime
/*
//查询buildtime包中的位置在github.com/duanhf2012/origin/v2/util/buildtime.BuildTime中
go tool nm ./originserver.exe |grep buildtime
//编译传入编译时间信息
go build -ldflags "-X 'github.com/duanhf2012/origin/v2/util/buildtime.BuildTime=20200101'"
go build -ldflags "-X github.com/duanhf2012/origin/v2/util/buildtime.BuildTime=20200101 -X github.com/duanhf2012/origin/v2/util/buildtime.BuildTag=debug"
*/
var BuildTime string
var BuildTag string
func GetBuildDateTime() string {
return BuildTime
}
func GetBuildTag() string {
return BuildTag
}