mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 02:31:04 +01:00
24 lines
377 B
Go
24 lines
377 B
Go
|
//go:build go1.18
|
||
|
|
||
|
package context
|
||
|
|
||
|
import "runtime/debug"
|
||
|
|
||
|
func init() {
|
||
|
if info, ok := debug.ReadBuildInfo(); ok {
|
||
|
for _, setting := range info.Settings {
|
||
|
if BuildRevision != "" && BuildTime != "" {
|
||
|
break
|
||
|
}
|
||
|
|
||
|
if setting.Key == "vcs.revision" {
|
||
|
BuildRevision = setting.Value
|
||
|
}
|
||
|
|
||
|
if setting.Key == "vcs.time" {
|
||
|
BuildTime = setting.Key
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|