aboutsummaryrefslogtreecommitdiff
path: root/build/build.go
blob: de6af5df7a200c44e239e662b93cb269cc6a1284 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package build

import "runtime/debug"

// Version is dynamically set during build by the toolchain or overridden in the Makefile.
var Version = "dev"

// Date is dynamically set during build time in the Makefile.
var Date = "unknown"

func init() {
	if Version == "dev" {
		if info, ok := debug.ReadBuildInfo(); ok && info.Main.Version != "(devel)" {
			Version = info.Main.Version
		}
	}
}