Documentation ¶
Overview ¶
Package gvgo used to parse version info.
Index ¶
Constants ¶
View Source
const ( KindAlpha = "alpha" KindBeta = "beta" KindRC = "rc" )
Variables ¶
View Source
var ( ErrMissMain error = versionError{"main part is empty"} ErrMainLong error = versionError{"main part is too long"} )
Functions ¶
func IsValidKind ¶ added in v0.2.0
IsValidKind returns true if kind is one of kinds("alpha", "beta" and "rc").
Types ¶
type Version ¶
type Version struct { Major string // decimal Minor string // decimal or "" Patch string // decimal or "" Kind string // "", "alpha", "beta", "rc" Pre string // decimal or "" }
A Version is a parsed version: major[.Minor[.Patch]][-kind[(.)pre]] The numbers are the original decimal strings to avoid integer overflows and since there is very little actual math. (Probably overflow doesn't matter in practice, but at the time this code was written, there was an existing test that used 1.99999999999, which does not fit in an int on 32-bit platforms. The "big decimal" representation avoids the problem entirely.)
Click to show internal directories.
Click to hide internal directories.