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

Function parseSingle

pkg/util/constraint/constraint.go:159–178  ·  view source on GitHub ↗
(v string)

Source from the content-addressed store, hash-verified

157}
158
159func parseSingle(v string) (*Constraint, error) {
160 matches := constraintRegexp.FindStringSubmatch(v)
161 if matches == nil {
162 return nil, fmt.Errorf("malformed constraint: %s", v)
163 }
164
165 check, err := NewVersion(matches[2])
166 if err != nil {
167 return nil, err
168 }
169
170 cop := constraintOperators[matches[1]]
171
172 return &Constraint{
173 f: cop.f,
174 op: cop.op,
175 check: check,
176 original: v,
177 }, nil
178}
179
180func prereleaseCheck(v, c *Version) bool {
181 switch vPre, cPre := v.Prerelease() != "", c.Prerelease() != ""; {

Callers 1

NewConstraintFunction · 0.85

Calls 2

NewVersionFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected