From af2a0a8167d54582088696545694d804da88f18e Mon Sep 17 00:00:00 2001 From: "Hana (Hyang-Ah) Kim" Date: Tue, 2 Aug 2022 23:28:18 -0400 Subject: [PATCH] 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 Reviewed-by: Robert Findley TryBot-Result: Gopher Robot Run-TryBot: Hyang-Ah Hana Kim gopls-CI: kokoro --- internal/lsp/command.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/lsp/command.go b/internal/lsp/command.go index f830a97c98..1d6c973212 100644 --- a/internal/lsp/command.go +++ b/internal/lsp/command.go @@ -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