From c7341709c66c528afd4603c094bf9bd285228911 Mon Sep 17 00:00:00 2001 From: Rohan Challa Date: Mon, 23 Dec 2019 11:33:23 -0500 Subject: [PATCH] internal/lsp: cleanup temporary go.mod file on shutdown This commit will delete the temporary go.mod file that is attached to a view when the session is shutdown. Updates golang/go#31999 Change-Id: I0f6b0663b0a814ce45d9b12468669f415f8c36aa Reviewed-on: https://go-review.googlesource.com/c/tools/+/212479 Reviewed-by: Rebecca Stambler Run-TryBot: Rohan Challa TryBot-Result: Gobot Gobot --- internal/lsp/cache/view.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/lsp/cache/view.go b/internal/lsp/cache/view.go index b9cd3007d2..428584850d 100644 --- a/internal/lsp/cache/view.go +++ b/internal/lsp/cache/view.go @@ -304,6 +304,9 @@ func (v *view) shutdown(context.Context) { v.cancel() v.cancel = nil } + if v.modfiles != nil { + os.Remove(v.modfiles.temp) + } debug.DropView(debugView{v}) }