// See the License for the specific language governing permissions and
// limitations under the License.
+// Package version keeps track of versioning info for GoVPP.
package version
import (
"time"
)
+const (
+ Major = 0
+ Minor = 4
+ Patch = 0
+ PreRelease = "dev"
+)
+
+// 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.