+const (
+ Major = 0
+ Minor = 5
+ Patch = 0
+ PreRelease = ""
+)
+
+// String formats the version string using semver format.
+func String() string {
+ v := fmt.Sprintf("v%d.%d.%d", Major, Minor, Patch)
+ if PreRelease != "" {
+ v += "-" + PreRelease
+ }
+ return v
+}
+
+// Following variables should normally be updated via `-ldflags "-X ..."`.
+// However, the version string is hard-coded to ensure it is always included
+// even with bare go build/install.