From 50b4f1b124a3a03ca655a70817a9b95eedab863d Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Sat, 10 Feb 2024 17:57:29 -0500 Subject: [PATCH] gopls/internal/golang: close open file Found while thinking about typestate. Change-Id: Ia98ace4782be34d1201f0ce5c8e536314fc494d7 Reviewed-on: https://go-review.googlesource.com/c/tools/+/563155 Reviewed-by: Robert Findley LUCI-TryBot-Result: Go LUCI Commit-Queue: Alan Donovan Auto-Submit: Alan Donovan --- gopls/internal/golang/gc_annotations.go | 1 + 1 file changed, 1 insertion(+) diff --git a/gopls/internal/golang/gc_annotations.go b/gopls/internal/golang/gc_annotations.go index 8bcf402cf1f..1ff866122ca 100644 --- a/gopls/internal/golang/gc_annotations.go +++ b/gopls/internal/golang/gc_annotations.go @@ -34,6 +34,7 @@ func GCOptimizationDetails(ctx context.Context, snapshot *cache.Snapshot, mp *me if err != nil { return nil, err } + tmpFile.Close() // ignore error defer os.Remove(tmpFile.Name()) outDirURI := protocol.URIFromPath(outDir)