MCPcopy Create free account
hub / github.com/devspace-sh/devspace / NewSemver

Function NewSemver

pkg/util/constraint/version.go:56–58  ·  view source on GitHub ↗

NewSemver parses the given version and returns a new Version that adheres strictly to SemVer specs https://semver.org/

(v string)

Source from the content-addressed store, hash-verified

54// Version that adheres strictly to SemVer specs
55// https://semver.org/
56func NewSemver(v string) (*Version, error) {
57 return newVersion(v, semverRegexp)
58}
59
60func newVersion(v string, pattern *regexp.Regexp) (*Version, error) {
61 matches := pattern.FindStringSubmatch(v)

Callers 3

ensureRequiresMethod · 0.92
TestNewSemverFunction · 0.85

Calls 1

newVersionFunction · 0.85

Tested by 2

TestNewSemverFunction · 0.68