mirror of
https://github.com/github/codeql.git
synced 2026-05-02 12:15:17 +02:00
Remove vendored path prefix of vendored packages
This commit is contained in:
@@ -12,7 +12,11 @@ class Package extends @package {
|
||||
string getName() { packages(this, result, _, _) }
|
||||
|
||||
/** Gets the path of this package. */
|
||||
string getPath() { packages(this, _, result, _) }
|
||||
string getPath() {
|
||||
exists(string fullPath | packages(this, _, fullPath, _) |
|
||||
result = fullPath.regexpReplaceAll("^.*/vendor/", "")
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets the scope of this package. */
|
||||
PackageScope getScope() { packages(this, _, _, result) }
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
| package errors | errors |
|
||||
| package fmt | fmt |
|
||||
| package github.com/github/codeql-go/ql/test/library-tests/semmle/go/main | github.com/github/codeql-go/ql/test/library-tests/semmle/go/main |
|
||||
| package github.com/nonexistent-test-pkg | github.com/nonexistent-test-pkg |
|
||||
| package internal/bytealg | internal/bytealg |
|
||||
| package internal/cpu | internal/cpu |
|
||||
| package internal/fmtsort | internal/fmtsort |
|
||||
| package internal/oserror | internal/oserror |
|
||||
| package internal/poll | internal/poll |
|
||||
| package internal/race | internal/race |
|
||||
| package internal/reflectlite | internal/reflectlite |
|
||||
| package internal/syscall/unix | internal/syscall/unix |
|
||||
| package internal/testlog | internal/testlog |
|
||||
| package io | io |
|
||||
| package math | math |
|
||||
| package math/bits | math/bits |
|
||||
| package os | os |
|
||||
| package reflect | reflect |
|
||||
| package runtime | runtime |
|
||||
| package runtime/internal/atomic | runtime/internal/atomic |
|
||||
| package runtime/internal/math | runtime/internal/math |
|
||||
| package runtime/internal/sys | runtime/internal/sys |
|
||||
| package sort | sort |
|
||||
| package strconv | strconv |
|
||||
| package sync | sync |
|
||||
| package sync/atomic | sync/atomic |
|
||||
| package syscall | syscall |
|
||||
| package time | time |
|
||||
| package unicode | unicode |
|
||||
| package unicode/utf8 | unicode/utf8 |
|
||||
| package unsafe | unsafe |
|
||||
4
ql/test/library-tests/semmle/go/Packages/PackagePath.ql
Normal file
4
ql/test/library-tests/semmle/go/Packages/PackagePath.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import go
|
||||
|
||||
from Package pkg
|
||||
select pkg, pkg.getPath()
|
||||
5
ql/test/library-tests/semmle/go/Packages/go.mod
Normal file
5
ql/test/library-tests/semmle/go/Packages/go.mod
Normal file
@@ -0,0 +1,5 @@
|
||||
module github.com/github/codeql-go/ql/test/library-tests/semmle/go/main
|
||||
|
||||
go 1.13
|
||||
|
||||
require github.com/nonexistent-test-pkg v0.0.0-20200203000000-0000000000000
|
||||
12
ql/test/library-tests/semmle/go/Packages/main.go
Normal file
12
ql/test/library-tests/semmle/go/Packages/main.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/nonexistent-test-pkg"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pkg.Foo()
|
||||
fmt.Println("")
|
||||
}
|
||||
1
ql/test/library-tests/semmle/go/Packages/vendor/github.com/nonexistent-test-pkg/README.md
generated
vendored
Normal file
1
ql/test/library-tests/semmle/go/Packages/vendor/github.com/nonexistent-test-pkg/README.md
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
This is a simple stub package, strictly for use in query testing.
|
||||
5
ql/test/library-tests/semmle/go/Packages/vendor/github.com/nonexistent-test-pkg/pkg.go
generated
vendored
Normal file
5
ql/test/library-tests/semmle/go/Packages/vendor/github.com/nonexistent-test-pkg/pkg.go
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
package pkg
|
||||
|
||||
func Foo() string {
|
||||
return "foo"
|
||||
}
|
||||
2
ql/test/library-tests/semmle/go/Packages/vendor/modules.txt
vendored
Normal file
2
ql/test/library-tests/semmle/go/Packages/vendor/modules.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# github.com/nonexistent-test-pkg v0.0.0-20200203000000-0000000000000
|
||||
github.com/nonexistent-test-package
|
||||
Reference in New Issue
Block a user