Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrReleaseNumberIsTooLarge = errors.New("release number is too large")
ErrReleaseNumberIsTooLarge is produced by MakeVersionQuad when numeric suffix is out of range.
var ErrUnsupportedPR = errors.New("unsupported pre-release content")
ErrUnsupportedPR is produced by MakeVersionQuad for unsupported pre-release suffixes.
var ErrVersionNumberIsTooLarge = errors.New("version number is too large")
ErrVersionNumberIsTooLarge is produced by MakeVersionQuad when one of the numbers is out of range.
Functions ¶
This section is empty.
Types ¶
type Quad ¶
type Quad goversioninfo.FileVersion
Quad can be used to form version quads from semantic versions. These are required for embedding numeric versions into Windows resources.
func MakeQuad ¶
MakeQuad constructs a version quad from a semantic version and the number of additional commits.
To keep the numbers consistent with Win32 storage (2-bytes per number), this function will reject certain inputs where numbers are too large
The first triplet is taken from the semantic version, the Build number is formed as:
- alphas ('alpha', 'a' PR suffixes): are 10000+ numbers
- betas ('beta', 'b' PR suffixes): are 20000+ numbers
- release candidates ('rc' suffixes): are 30000+ numbers
- releases (no suffixes): are 50000+ numbers
The .<number> after the PR suffix, if present is multiplied by a 100 and added to the Build number. Same works for releases with -<number> suffix.
The number of additional commits is added to the Build number.
Examples:
- v1.0.0-alpha -> 1.0.0.10000
- v1.0.0-alpha.1 -> 1.0.0.10100
- v1.0.0-alpha.1 + 7 commits -> 1.0.0.10107
- v1.0.0-rc.5 -> 1.0.0.30500
- v1.0.0 -> 1.0.0.50000
- v1.0.0-5 -> 1.0.0.50005
see stats-test.go for more examples
func (Quad) CommaSeparatedString ¶
CommaSeparatedString produces #,#,#,# output, this is useful when code-generating Win32 resources