Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 0.9% on proxy.golang.org
Top 0.1% dependent packages on proxy.golang.org
Top 0.1% dependent repos on proxy.golang.org
Top 2.5% forks on proxy.golang.org
Top 0.1% docker downloads on proxy.golang.org

proxy.golang.org : github.com/Masterminds/semver

Package semver provides the ability to work with Semantic Versions (http://semver.org) in Go. Specifically it provides the ability to: To parse a semantic version use the `NewVersion` function. For example, If there is an error the version wasn't parseable. The version object has methods to get the parts of the version, compare it to other versions, convert the version back into a string, and get the original string. For more details please see the documentation at https://godoc.org/github.com/Masterminds/semver. A set of versions can be sorted using the `sort` package from the standard library. For example, Checking a version against version constraints is one of the most featureful parts of the package. There are two elements to the comparisons. First, a comparison string is a list of comma separated and comparisons. These are then separated by || separated or comparisons. For example, `">= 1.2, < 3.0.0 || >= 4.2.3"` is looking for a comparison that's greater than or equal to 1.2 and less than 3.0.0 or is greater than or equal to 4.2.3. The basic comparisons are: There are multiple methods to handle ranges and the first is hyphens ranges. These look like: The `x`, `X`, and `*` characters can be used as a wildcard character. This works for all comparison operators. When used on the `=` operator it falls back to the pack level comparison (see tilde below). For example, Tilde Range Comparisons (Patch) The tilde (`~`) comparison operator is for patch level ranges when a minor version is specified and major level changes when the minor number is missing. For example, Caret Range Comparisons (Major) The caret (`^`) comparison operator is for major level changes. This is useful when comparisons of API versions as a major change is API breaking. For example,

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/%21masterminds/semver
Keywords: caret, comparison, constraints, go, golang, semantic-versions, semver, tilde
License: MIT
Latest release: over 4 years ago
First release: almost 8 years ago
Namespace: github.com/Masterminds
Dependent packages: 6,701
Dependent repositories: 22,957
Stars: 939 on GitHub
Forks: 112 on GitHub
Docker dependents: 3,483
Docker downloads: 13,723,278,048
See more repository details: repos.ecosyste.ms
Last synced: about 9 hours ago

    Loading...
    Readme
    Loading...