19 lines
397 B
Go
19 lines
397 B
Go
package version
|
|
|
|
import "fmt"
|
|
|
|
// Thanks to the following blog post for how to use the linker flags
|
|
// to pass in build-time variables.
|
|
//
|
|
// https://belief-driven-design.com/build-time-variables-in-go-51439b26ef9/
|
|
|
|
var (
|
|
Version = "dev"
|
|
CommitHash = "n/a"
|
|
BuildTimestamp = "n/a"
|
|
)
|
|
|
|
func BuildVersion() string {
|
|
return fmt.Sprintf("%s %s %s", Version, CommitHash, BuildTimestamp)
|
|
}
|