package
0.0.9
Repository: https://github.com/activestate/langtools.git
Documentation: pkg.go.dev

# Functions

Compare returns: <0 if the version in v1 is less than the version in v2 0 if the version in v1 is equal to the version in v2 >0 if the version in v1 is greater than the version in v2 Versions that differ only by trailing zeros (e.g.
ParsedAsString retrieves an enum value from the enum constants string name.
ParsedAsValues returns all values of the enum.
ParseGeneric parses the version string into an array of decimal numbers such that two parsed version strings can be compared.
ParsePerl parses version using the version parsing algorithm used by version.pm (https://metacpan.org/pod/distribution/version/lib/version.pm).
ParsePHP attempts to parse a version according to the same rules used by composer (https://github.com/composer/semver).
ParsePython attempts to parse a version according to PEP440 (https://www.python.org/dev/peps/pep-0440/) and falls back to legacy Python parsing if that fails.
ParseRuby attempts to parse a version according to the same rules used by rubygems (https://github.com/rubygems/rubygems).
ParseSemVer parses the semantic version (https://semver.org/) version string into an array of decimal numbers such that two parsed version strings can be compared as required by the semantic versioning specification.

# Constants

Generic is a generic version.
PerlDecimal is for Perl versions which are simply numbers (42, 1.2, etc.).
PerlVString is for Perl v-strings like "v1.1.2" (but these don't require the leading "v", so "1.2.3" is also valid).
PHP is for PHP versions as used by composer.
PythonLegacy is for Python versions before PEP440 was adopted.
PythonPEP440 is for versions as described in PEP440.
Ruby is for Ruby versions.
SemVer is the well known semver scheme (https://semver.org/).
Unknown should never be used.

# Structs

Version is the struct returned from all parsing funcs.

# Type aliases

ParsedAs is an enum for the various types of versions we can parse.