maddy/build_info.go
fox.cpp b3a09835de
Move all code from cmd/maddy into root package
Build info helpers can be reused by maddyctl.
Same goes for directory configuration.
2019-11-15 19:34:20 +03:00

17 lines
314 B
Go

package maddy
import (
"runtime/debug"
)
var Version = "unknown (built from source tree)"
func BuildInfo() string {
if info, ok := debug.ReadBuildInfo(); ok {
if info.Main.Version == "(devel)" {
return Version
}
return info.Main.Version + " " + info.Main.Sum
}
return Version + " (GOPATH build)"
}