From 6f129528bc8ca1ad7b1aef3e748d32e8c54fc999 Mon Sep 17 00:00:00 2001 From: guangwu Date: Sat, 18 May 2024 14:53:44 +0800 Subject: [PATCH] fix: close go.mod --- cmd/internal/openapi/v3/codegen/server/svc.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/internal/openapi/v3/codegen/server/svc.go b/cmd/internal/openapi/v3/codegen/server/svc.go index 90dd9034..f380848f 100644 --- a/cmd/internal/openapi/v3/codegen/server/svc.go +++ b/cmd/internal/openapi/v3/codegen/server/svc.go @@ -50,6 +50,7 @@ func GenSvcGo(dir string, docPath string) { if modf, err = os.Open(modfile); err != nil { panic(err) } + defer modf.Close() reader := bufio.NewReader(modf) firstLine, _ := reader.ReadString('\n') modName := strings.TrimSpace(strings.TrimPrefix(firstLine, "module"))