mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-26 08:14:43 +08:00
新增编译标记以及编译操作系统类型
This commit is contained in:
@@ -15,3 +15,7 @@ func KillProcess(processId int){
|
|||||||
fmt.Printf("kill processid %d is successful.\n",processId)
|
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)
|
fmt.Printf("kill processid %d is successful.\n",processId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetBuildOSType() BuildOSType{
|
||||||
|
return Mac
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,4 +4,8 @@ package node
|
|||||||
|
|
||||||
func KillProcess(processId int){
|
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'"
|
||||||
|
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 BuildTime string
|
||||||
|
var BuildTag string
|
||||||
|
|
||||||
func GetBuildDateTime() string {
|
func GetBuildDateTime() string {
|
||||||
return BuildTime
|
return BuildTime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetBuildTag() string {
|
||||||
|
return BuildTag
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user