From 1e8dcfd6517201c3a467109ae133846cc66e053a Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Mon, 1 Apr 2024 09:34:31 +0800 Subject: [PATCH] cmd/go/internal/modload: close modules.txt Signed-off-by: guoguangwu --- src/cmd/go/internal/modload/init.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cmd/go/internal/modload/init.go b/src/cmd/go/internal/modload/init.go index 0c73b00022..1de9901563 100644 --- a/src/cmd/go/internal/modload/init.go +++ b/src/cmd/go/internal/modload/init.go @@ -1465,6 +1465,7 @@ func modulesTextIsForWorkspace(vendorDir string) (bool, error) { if err != nil { return false, err } + defer f.Close() var buf [512]byte n, err := f.Read(buf[:]) if err != nil && err != io.EOF {