File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
go/ql/lib/semmle/go/dataflow Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -322,17 +322,18 @@ private predicate elementSpec(
322
322
*/
323
323
bindingset [ p]
324
324
private string interpretPackage ( string p ) {
325
- exists ( Package pkg | result = pkg .getPath ( ) |
326
- exists ( string thisVersion , string specifiedVersionRegex |
327
- thisVersion = "$THISVERSION" and
328
- specifiedVersionRegex = "[./]v\\d+"
329
- |
330
- if p .suffix ( p .length ( ) - thisVersion .length ( ) ) = thisVersion
331
- then result = p .prefix ( p .length ( ) - 12 )
332
- else
333
- if exists ( p .regexpFind ( specifiedVersionRegex , 0 , _) )
334
- then result = p
335
- else p = pkg .getPathWithoutMajorVersionSuffix ( )
325
+ exists ( Package pkg , string thisVersion , string specifiedVersionRegex |
326
+ result = pkg .getPath ( ) and
327
+ thisVersion = "$THISVERSION" and
328
+ specifiedVersionRegex = "[./]v\\d+"
329
+ |
330
+ p = result + thisVersion
331
+ or
332
+ not p = any ( string s ) + thisVersion and
333
+ (
334
+ if exists ( p .regexpFind ( specifiedVersionRegex , 0 , _) )
335
+ then result = p
336
+ else p = pkg .getPathWithoutMajorVersionSuffix ( )
336
337
)
337
338
)
338
339
or
You can’t perform that action at this time.
0 commit comments