-
Notifications
You must be signed in to change notification settings - Fork 1
/
version.go
48 lines (43 loc) · 1.28 KB
/
version.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package version
//go:generate go run ./update/.
import (
"fmt"
)
var (
// URL is the git URL for the repository
URL = "github.com/p9c/qu"
// GitRef is the gitref, as in refs/heads/branchname
GitRef = "refs/heads/main"
// GitCommit is the commit hash of the current HEAD
GitCommit = "d6fe62c87da66de03e5c4f416e968f5e08b6f1f1"
// BuildTime stores the time when the current binary was built
BuildTime = "2021-04-30T20:19:18+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.10"
// PathBase is the path base returned from runtime caller
PathBase = "/home/loki/src/github.com/p9c/pod/pkg/qu/"
// 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 = 10
// 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",
)
}