internal/lsp: use exec.CommandContext when running vulncheck

That, hopefully, handles process termination upon context
cancellation. (not 100% guaranteed)

Change-Id: I79441afb794c37e9e55f710f124871a82aa4effe
Reviewed-on: https://go-review.googlesource.com/c/tools/+/420997
Reviewed-by: Suzy Mueller <suzmue@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Hyang-Ah Hana Kim <hyangah@gmail.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Hana (Hyang-Ah) Kim 2022-08-02 23:28:18 -04:00 committed by Hyang-Ah Hana Kim
parent 3519aa25b8
commit af2a0a8167
1 changed files with 1 additions and 1 deletions

View File

@ -817,7 +817,7 @@ func (c *commandHandler) RunVulncheckExp(ctx context.Context, args command.Vulnc
return errors.New("vulncheck feature is not available")
}
cmd := exec.Command(os.Args[0], "vulncheck", "-config", args.Pattern)
cmd := exec.CommandContext(ctx, os.Args[0], "vulncheck", "-config", args.Pattern)
cmd.Dir = filepath.Dir(args.URI.SpanURI().Filename())
var viewEnv []string