Files
interrupt/version/version.go
Loki Verloren 0b9edd9240 update version
2021-04-30 18:42:38 +02:00

49 lines
1.3 KiB
Go

package version
//go:generate go run ./update/.
import (
"fmt"
)
var (
// URL is the git URL for the repository
URL = "github.com/p9c/interrupt"
// GitRef is the gitref, as in refs/heads/branchname
GitRef = "refs/heads/main"
// GitCommit is the commit hash of the current HEAD
GitCommit = "86a6516bbff5524c52f475ed124b7f8f27ad219d"
// BuildTime stores the time when the current binary was built
BuildTime = "2021-04-30T18:33:26+02:00"
// Tag lists the Tag on the build, adding a + to the newest Tag if the commit is
// not that commit
Tag = "v0.0.3"
// PathBase is the path base returned from runtime caller
PathBase = "/home/loki/src/github.com/p9c/pod/pkg/interrupt/"
// Major is the major number from the tag
Major = 0
// Minor is the minor number from the tag
Minor = 0
// Patch is the patch version number from the tag
Patch = 3
// Meta is the extra arbitrary string field from Semver spec
Meta = ""
)
// Get returns a pretty printed version information string
func Get() string {
return fmt.Sprint(
"\nRepository Information\n"+
"\tGit repository: "+URL+"\n",
"\tBranch: "+GitRef+"\n"+
"\tCommit: "+GitCommit+"\n"+
"\tBuilt: "+BuildTime+"\n"+
"\tTag: "+Tag+"\n",
"\tMajor:", Major, "\n",
"\tMinor:", Minor, "\n",
"\tPatch:", Patch, "\n",
"\tMeta: ", Meta, "\n",
)
}