Documentation ¶
Overview ¶
Package goversion contains utilities to parse and store a Go toolset version. It also handles extra parts that are used by the Microsoft build of Go to describe how it was built.
Index ¶
- type GoVersion
- func (v *GoVersion) Full() string
- func (v *GoVersion) MajorMinor() string
- func (v *GoVersion) MajorMinorPatch() string
- func (v *GoVersion) MajorMinorPatchPrerelease() string
- func (v *GoVersion) MajorMinorPatchPrereleaseRevision() string
- func (v *GoVersion) MajorMinorPrerelease() string
- func (v *GoVersion) NoteWithPrefix() string
- func (v *GoVersion) String() string
- func (v *GoVersion) UpstreamFormatGitTag() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GoVersion ¶
type GoVersion struct { // Original is the source data, without any defaults filled in. Original string // Major is the major version in semver terms, as in "Go 1". Major string // Minor is the minor version, referred to by Go as "major releases". Default: 0 Minor string // Patch is the patch version, referred to by Go as "minor revisions". Default: 0. Patch string // Revision is an integer immediately after the first '-' (if any). These are revisions of the // Microsoft build and aren't associated with official Go releases. Default: 1. Revision string // Note is a non-integer string after a '-' separator, or not included. Common use is to // specify 'fips'. Default: empty string, indicating not provided. Note string // Prerelease is a beta or rc version string, for example "rc1" in "1.18rc1" or "beta1" in // "2beta1". After normal parsing, the major, minor, and patch version strings are scanned for a // non-numeric section. If one is found, it is removed from that part of the version and stored // in Prerelease. Prerelease string }
GoVersion is the parsed representation of a Microsoft-built Go toolset version.
func (*GoVersion) Full ¶
Full returns the full normalized version string, including Note if specified.
func (*GoVersion) MajorMinor ¶
func (*GoVersion) MajorMinorPatch ¶
func (*GoVersion) MajorMinorPatchPrerelease ¶
func (*GoVersion) MajorMinorPatchPrereleaseRevision ¶
func (*GoVersion) MajorMinorPrerelease ¶
func (*GoVersion) NoteWithPrefix ¶
NoteWithPrefix is a utility to help with version string construction. Returns Note with a "-" prefix, or empty string if Note isn't specified.
func (*GoVersion) UpstreamFormatGitTag ¶
UpstreamFormatGitTag returns the version in the format upstream uses for Git tags.
Click to show internal directories.
Click to hide internal directories.