cockroach: Index | Files

package version

import ""


Package Files


type Version Uses

type Version struct {
    // contains filtered or unexported fields

Version represents a semantic version; see

func MustParse Uses

func MustParse(str string) *Version

MustParse is like Parse but panics on any error. Recommended as an initializer for global values.

func Parse Uses

func Parse(str string) (*Version, error)

Parse creates a version from a string. The string must be a valid semantic version (as per in the format:


MINOR, MAJOR, and PATCH are numeric values (without any leading 0s). PRERELEASE and METADATA can contain ASCII characters and digits, hyphens and dots.

func (*Version) AtLeast Uses

func (v *Version) AtLeast(w *Version) bool

AtLeast returns true if v >= w.

func (*Version) Compare Uses

func (v *Version) Compare(w *Version) int

Compare returns -1, 0, or +1 indicating the relative ordering of versions.

func (*Version) Major Uses

func (v *Version) Major() int

Major returns the major (first) version number.

func (*Version) Metadata Uses

func (v *Version) Metadata() string

Metadata returns the metadata (if present).

func (*Version) Minor Uses

func (v *Version) Minor() int

Minor returns the minor (second) version number.

func (*Version) Patch Uses

func (v *Version) Patch() int

Patch returns the patch (third) version number.

func (*Version) PreRelease Uses

func (v *Version) PreRelease() string

PreRelease returns the pre-release version (if present).

func (Version) String Uses

func (v Version) String() string

String returns the string representation, in the format:


Package version imports 5 packages (graph) and is imported by 16 packages. Updated 2020-07-11. Refresh now. Tools for package owners.