From f5ffb27b866a4aa219419bf5e0dd9f423cc71332 Mon Sep 17 00:00:00 2001 From: guangwu Date: Thu, 18 Apr 2024 16:08:37 +0800 Subject: [PATCH] fix: close file --- go/model/model.go | 1 + 1 file changed, 1 insertion(+) diff --git a/go/model/model.go b/go/model/model.go index 62554c40b0..95f6af043d 100644 --- a/go/model/model.go +++ b/go/model/model.go @@ -316,6 +316,7 @@ func DumpDBModel(db *database.DB, table, cwd string) (string, error) { if err != nil { return "", fmt.Errorf("Can't careate model file: %v", err) } + defer file.Close() if _, err = io.Copy(file, sqlf); err != nil { return "", fmt.Errorf("Can't dump model to local file") }