-
Notifications
You must be signed in to change notification settings - Fork 14
/
version.go
38 lines (30 loc) · 1.15 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
// Package version defines the SDK version
package version
import (
"fmt"
goVersion "github.com/hashicorp/go-version"
)
// ProtocolVersion marks the protobuf interface version
// // Update this if breaking changes are made to the protobuf spec (for example column types)
var ProtocolVersion int64 = 20220201
// Version is the main version number that is being run at the moment.
var version = "5.10.1"
// A pre-release marker for the version. If this is "" (empty string)
// then it means that it is a final release. Otherwise, this is a pre-release
// such as "dev" (in development), "beta", "rc1", etc.
var prerelease = ""
// semVer is an instance of version.Version. This has the secondary
// benefit of verifying during tests and init time that our version is a
// proper semantic version, which should always be the case.
var semVer *goVersion.Version
func init() {
versionString := version
if prerelease != "" {
versionString = fmt.Sprintf("%s-%s", version, prerelease)
}
semVer = goVersion.Must(goVersion.NewVersion(versionString))
}
// String returns the complete version string, including prerelease
func String() string {
return semVer.String()
}