Skip to content

Commit c045e77

Browse files
committed
Fix QLDoc for interpretPackage
1 parent 7d11fc2 commit c045e77

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

go/ql/lib/semmle/go/dataflow/ExternalFlow.qll

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,13 @@ private predicate elementSpec(
312312
/**
313313
* Gets the string for the package path corresponding to `p`, if one exists.
314314
*
315-
* If `p` has `$THISVERSION` at the end then we remove that and do not attempt
316-
* to match any other versions of the same package. If `p` contains a major
317-
* version suffix (like "/v2") then we also do not attempt to match any
315+
* We attempt to account for major version suffixes as follows: if `p` is
316+
* `github.com/a/b/c/d` then we will return any path for a package that was
317+
* imported which matches that, possibly with a major version suffix in it,
318+
* so if `github.com/a/b/c/d/v2` or `github.com/a/b/v3/c/d` were imported then
319+
* they will be in the results. There are two situations where we do not do
320+
* this: (1) when `p` already contains a major version suffix; (2) if `p` has
321+
* `$THISVERSION` at the end (which we remove).
318322
*/
319323
bindingset[p]
320324
private string interpretPackage(string p) {

0 commit comments

Comments
 (0)