iris/context/context_go118.go

25 lines
396 B
Go
Raw Permalink Normal View History

2022-04-10 00:11:11 +02:00
//go:build go1.18
2022-05-24 00:44:36 +02:00
// +build go1.18
2022-04-10 00:11:11 +02:00
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" {
2022-04-18 09:52:47 +02:00
BuildTime = setting.Value
2022-04-10 00:11:11 +02:00
}
}
}
}