22 lines
448 B
Go
22 lines
448 B
Go
package buildinfo
|
|
|
|
import "runtime"
|
|
|
|
// Values may be overridden at build time with -ldflags -X.
|
|
var (
|
|
Version = "0.9.0"
|
|
Commit = "dev"
|
|
Date = "unknown"
|
|
)
|
|
|
|
type Info struct {
|
|
Version string `json:"version"`
|
|
Commit string `json:"commit"`
|
|
BuildDate string `json:"build_date"`
|
|
GoVersion string `json:"go_version"`
|
|
}
|
|
|
|
func Current() Info {
|
|
return Info{Version: Version, Commit: Commit, BuildDate: Date, GoVersion: runtime.Version()}
|
|
}
|