enable gitea actions
This commit is contained in:
36
buildinfo.go
Normal file
36
buildinfo.go
Normal file
@ -0,0 +1,36 @@
|
||||
package eway
|
||||
|
||||
import (
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
version string = "v0.0.0"
|
||||
commit string = "0000000"
|
||||
buildTimeStr string
|
||||
|
||||
buildTime time.Time
|
||||
|
||||
parseOnce sync.Once
|
||||
)
|
||||
|
||||
func Version() string {
|
||||
return version
|
||||
}
|
||||
|
||||
func Commit() string {
|
||||
return commit
|
||||
}
|
||||
|
||||
func BuildTime() time.Time {
|
||||
parseOnce.Do(func() {
|
||||
if buildTimeStr == "" {
|
||||
return
|
||||
}
|
||||
|
||||
buildTime, _ = time.Parse(buildTimeStr, time.RFC3339)
|
||||
})
|
||||
|
||||
return buildTime
|
||||
}
|
||||
Reference in New Issue
Block a user