mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
新增编译标记以及编译操作系统类型
This commit is contained in:
@@ -15,3 +15,7 @@ func KillProcess(processId int){
|
||||
fmt.Printf("kill processid %d is successful.\n",processId)
|
||||
}
|
||||
}
|
||||
|
||||
func GetBuildOSType() BuildOSType{
|
||||
return Linux
|
||||
}
|
||||
|
||||
@@ -15,3 +15,7 @@ func KillProcess(processId int){
|
||||
fmt.Printf("kill processid %d is successful.\n",processId)
|
||||
}
|
||||
}
|
||||
|
||||
func GetBuildOSType() BuildOSType{
|
||||
return Mac
|
||||
}
|
||||
|
||||
@@ -5,3 +5,7 @@ package node
|
||||
func KillProcess(processId int){
|
||||
|
||||
}
|
||||
|
||||
func GetBuildOSType() BuildOSType{
|
||||
return Windows
|
||||
}
|
||||
|
||||
@@ -6,10 +6,15 @@ go tool nm ./originserver.exe |grep buildtime
|
||||
|
||||
//编译传入编译时间信息
|
||||
go build -ldflags "-X 'github.com/duanhf2012/origin/util/buildtime.BuildTime=20200101'"
|
||||
go build -ldflags "-X github.com/duanhf2012/origin/util/buildtime.BuildTime=20200101 -X github.com/duanhf2012/origin/util/buildtime.BuildTag=debug"
|
||||
*/
|
||||
var BuildTime string
|
||||
|
||||
var BuildTag string
|
||||
|
||||
func GetBuildDateTime() string {
|
||||
return BuildTime
|
||||
}
|
||||
|
||||
func GetBuildTag() string {
|
||||
return BuildTag
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user