(v string)
| 157 | } |
| 158 | |
| 159 | func 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 | |
| 180 | func prereleaseCheck(v, c *Version) bool { |
| 181 | switch vPre, cPre := v.Prerelease() != "", c.Prerelease() != ""; { |
no test coverage detected