rearrange and document version pkg
This commit is contained in:
parent
e100208845
commit
b7143ed450
@ -1,3 +1,4 @@
|
|||||||
|
// Package version implements version parsing logic
|
||||||
package version
|
package version
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -8,15 +9,6 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Info : data structure for program version information
|
|
||||||
type info struct {
|
|
||||||
Major int
|
|
||||||
Minor int
|
|
||||||
Patch int
|
|
||||||
Prerelease []string
|
|
||||||
BuildMeta []string
|
|
||||||
}
|
|
||||||
|
|
||||||
// gitDescribe : Git's "git describe --always --dirty" output
|
// gitDescribe : Git's "git describe --always --dirty" output
|
||||||
var gitDescribe = ""
|
var gitDescribe = ""
|
||||||
|
|
||||||
@ -29,6 +21,15 @@ var OsArch = fmt.Sprintf("%s (%s)", runtime.GOOS, runtime.GOARCH)
|
|||||||
// Version : the complete version data
|
// Version : the complete version data
|
||||||
var Version = parseGitDescribe(gitDescribe)
|
var Version = parseGitDescribe(gitDescribe)
|
||||||
|
|
||||||
|
// Info : data structure for program version information
|
||||||
|
type info struct {
|
||||||
|
Major int
|
||||||
|
Minor int
|
||||||
|
Patch int
|
||||||
|
Prerelease []string
|
||||||
|
BuildMeta []string
|
||||||
|
}
|
||||||
|
|
||||||
// Equal compares two Info structs for equality
|
// Equal compares two Info structs for equality
|
||||||
func (i info) Equal(o info) bool {
|
func (i info) Equal(o info) bool {
|
||||||
if i.Major != o.Major || i.Minor != o.Minor || i.Patch != o.Patch {
|
if i.Major != o.Major || i.Minor != o.Minor || i.Patch != o.Patch {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user