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") }