We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c2de231 + 43df615 commit ac9bfc9Copy full SHA for ac9bfc9
constraint.go
@@ -66,6 +66,16 @@ func NewConstraint(v string) (Constraints, error) {
66
return Constraints(result), nil
67
}
68
69
+// MustConstraints is a helper that wraps a call to a function
70
+// returning (Constraints, error) and panics if error is non-nil.
71
+func MustConstraints(c Constraints, err error) Constraints {
72
+ if err != nil {
73
+ panic(err)
74
+ }
75
+
76
+ return c
77
+}
78
79
// Check tests if a version satisfies all the constraints.
80
func (cs Constraints) Check(v *Version) bool {
81
for _, c := range cs {
0 commit comments