Skip to content

Commit 46d0c6f

Browse files
committed
Use lookahead in regex to not match e.g. "/v2foo"
1 parent c8a3bed commit 46d0c6f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/ql/lib/semmle/go/Packages.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Package extends @package {
3333
string toString() { result = "package " + this.getPath() }
3434
}
3535

36-
string majorVersionSuffixRegex() { result = "[./]v\\d+" }
36+
string majorVersionSuffixRegex() { result = "[./]v\\d+(?=$|/)" }
3737

3838
/**
3939
* Gets an import path that identifies a package in module `mod` with the given path,

0 commit comments

Comments
 (0)