Skip to content

Commit 8e81ec5

Browse files
committed
tags can have an +incompatible suffix too
1 parent 66d3e17 commit 8e81ec5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

tuple/tuple.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ var versionRx = regexp.MustCompile(`\A(v\d+\.\d+\.\d+(?:-[0-9A-Za-z]+[0-9A-Za-z\
251251
// v1.2.3-20181001143604-e0a95dfd547c
252252
// v1.2.3-3.20181001143604-e0a95dfd547c
253253
// v0.8.0-dev.2.0.20180608203834-19279f049241
254-
var tagRx = regexp.MustCompile(`\Av\d+\.\d+\.\d+-(?:[0-9A-Za-z\.]+\.)?\d{14}-([0-9a-f]+)\z`)
254+
// v3.0.1-0.20190209023717-9147687966d9+incompatible
255+
var tagRx = regexp.MustCompile(`\Av\d+\.\d+\.\d+-(?:[0-9A-Za-z\.]+\.)?\d{14}-([0-9a-f]+)(?:\+incompatible)?\z`)
255256

256257
// Parse parses a package spec into Tuple.
257258
func Parse(spec, packagePrefix string) (*Tuple, error) {

tuple/tuple_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func TestParseTag(t *testing.T) {
8080
{"github.com/pkg/errors v1.2.3-0.20150716171945-2caba252f4dc", "2caba252f4dc"},
8181
{"github.com/pkg/errors v1.2.3-42.20150716171945-2caba252f4dc", "2caba252f4dc"},
8282
{"github.com/docker/libnetwork v0.8.0-dev.2.0.20180608203834-19279f049241", "19279f049241"},
83+
{"github.com/hjson/hjson-go v3.0.1-0.20190209023717-9147687966d9+incompatible", "9147687966d9"},
8384
}
8485

8586
for i, x := range examples {

0 commit comments

Comments
 (0)