1 package version
2 3 //go:generate go run ./update/.
4 5 import (
6 "fmt"
7 )
8 9 var (
10 11 // URL is the git URL for the repository
12 URL = "github.com/p9c/p9"
13 // GitRef is the gitref, as in refs/heads/branchname
14 GitRef = "refs/heads/main"
15 // GitCommit is the commit hash of the current HEAD
16 GitCommit = "40a7d8327e70dca9576a7257ad320106d62ee72f"
17 // BuildTime stores the time when the current binary was built
18 BuildTime = "2021-05-03T14:08:30+02:00"
19 // Tag lists the Tag on the build, adding a + to the newest Tag if the commit is
20 // not that commit
21 Tag = "v0.0.2+"
22 // PathBase is the path base returned from runtime caller
23 PathBase = "/home/loki/src/github.com/p9c/p9/"
24 // Major is the major number from the tag
25 Major = 0
26 // Minor is the minor number from the tag
27 Minor = 0
28 // Patch is the patch version number from the tag
29 Patch = 2
30 // Meta is the extra arbitrary string field from Semver spec
31 Meta = ""
32 )
33 34 // Get returns a pretty printed version information string
35 func Get() string {
36 return fmt.Sprint(
37 "\nRepository Information\n"+
38 "\tGit repository: "+URL+"\n",
39 "\tBranch: "+GitRef+"\n"+
40 "\tCommit: "+GitCommit+"\n"+
41 "\tBuilt: "+BuildTime+"\n"+
42 "\tTag: "+Tag+"\n",
43 "\tMajor:", Major, "\n",
44 "\tMinor:", Minor, "\n",
45 "\tPatch:", Patch, "\n",
46 "\tMeta: ", Meta, "\n",
47 )
48 }
49