1
0
mirror of https://github.com/golang/go synced 2024-11-05 20:26:13 -07:00

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 <rstambler@golang.org>
Run-TryBot: Rohan Challa <rohan@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Rohan Challa 2019-12-23 11:33:23 -05:00
parent a7b3459f04
commit c7341709c6

View File

@ -304,6 +304,9 @@ func (v *view) shutdown(context.Context) {
v.cancel() v.cancel()
v.cancel = nil v.cancel = nil
} }
if v.modfiles != nil {
os.Remove(v.modfiles.temp)
}
debug.DropView(debugView{v}) debug.DropView(debugView{v})
} }