diff --git a/internal/lsp/cmd/vulncheck.go b/internal/lsp/cmd/vulncheck.go index 19b3466a53..d5b05a9242 100644 --- a/internal/lsp/cmd/vulncheck.go +++ b/internal/lsp/cmd/vulncheck.go @@ -27,10 +27,6 @@ type pkgLoadConfig struct { // the build system's query tool. BuildFlags []string - // Env is the environment to use when invoking the build system's query tool. - // If Env is nil, the current environment is used. - Env []string - // If Tests is set, the loader includes related test packages. Tests bool } @@ -65,11 +61,6 @@ func (v *vulncheck) Run(ctx context.Context, args ...string) error { if len(args) == 1 { pattern = args[0] } - - cwd, err := os.Getwd() - if err != nil { - return tool.CommandLineErrorf("failed to get current directory: %v", err) - } var cfg pkgLoadConfig if v.Config { if err := json.NewDecoder(os.Stdin).Decode(&cfg); err != nil { @@ -87,8 +78,7 @@ func (v *vulncheck) Run(ctx context.Context, args ...string) error { Context: ctx, Tests: cfg.Tests, BuildFlags: cfg.BuildFlags, - Env: cfg.Env, - Dir: cwd, + // inherit the current process's cwd and env. } res, err := opts.Hooks.Govulncheck(ctx, loadCfg, pattern) diff --git a/internal/lsp/command.go b/internal/lsp/command.go index 6df909bdb1..f830a97c98 100644 --- a/internal/lsp/command.go +++ b/internal/lsp/command.go @@ -797,11 +797,6 @@ type pkgLoadConfig struct { // the build system's query tool. BuildFlags []string - // Env is the environment to use when invoking the build system's query tool. - // If Env is nil, the current environment is used. - // TODO: This seems unnecessary. Delete. - Env []string - // If Tests is set, the loader includes related test packages. Tests bool }