Skip to content

Commit 1959065

Browse files
authored
Merge pull request #176 from mtt0/master
Fix constraints check with *-0
2 parents 3248ef7 + 9f3b646 commit 1959065

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

constraints.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func parseConstraint(c string) (*constraint, error) {
233233
patchDirty := false
234234
dirty := false
235235
if isX(m[3]) || m[3] == "" {
236-
ver = "0.0.0"
236+
ver = fmt.Sprintf("0.0.0%s", m[6])
237237
dirty = true
238238
} else if isX(strings.TrimPrefix(m[4], ".")) || m[4] == "" {
239239
minorDirty = true

constraints_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ func TestConstraintCheck(t *testing.T) {
121121
{"*", "1", true},
122122
{"*", "4.5.6", true},
123123
{"*", "1.2.3-alpha.1", false},
124+
{"*-0", "1.2.3-alpha.1", true},
124125
{"2.*", "1", false},
125126
{"2.*", "3.4.5", false},
126127
{"2.*", "2.1.1", true},

0 commit comments

Comments
 (0)