diff options
Diffstat (limited to 'gopls/internal/vulncheck/vulncheck.go')
-rw-r--r-- | gopls/internal/vulncheck/vulncheck.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gopls/internal/vulncheck/vulncheck.go b/gopls/internal/vulncheck/vulncheck.go index 2c4d0d297..3c361bd01 100644 --- a/gopls/internal/vulncheck/vulncheck.go +++ b/gopls/internal/vulncheck/vulncheck.go @@ -10,14 +10,16 @@ package vulncheck import ( "context" - "errors" "golang.org/x/tools/go/packages" - "golang.org/x/tools/internal/lsp/command" + "golang.org/x/tools/gopls/internal/govulncheck" + "golang.org/x/tools/gopls/internal/lsp/source" ) -// Govulncheck runs the in-process govulncheck implementation. // With go1.18+, this is swapped with the real implementation. -var Govulncheck = func(ctx context.Context, cfg *packages.Config, args command.VulncheckArgs) (res command.VulncheckResult, _ error) { - return res, errors.New("not implemented") -} +var Main func(cfg packages.Config, patterns ...string) error = nil + +// VulnerablePackages queries the vulndb and reports which vulnerabilities +// apply to this snapshot. The result contains a set of packages, +// grouped by vuln ID and by module. +var VulnerablePackages func(ctx context.Context, snapshot source.Snapshot, modfile source.FileHandle) (*govulncheck.Result, error) = nil |