From 45229ce1f45048db6cfbf6d2adfb963675e58971 Mon Sep 17 00:00:00 2001 From: guangwu Date: Sun, 7 Apr 2024 13:47:06 +0800 Subject: [PATCH] fix: close file in the generateAtDir func --- pkg/cheatsheet/generate.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/cheatsheet/generate.go b/pkg/cheatsheet/generate.go index 27667e686..8d1966458 100644 --- a/pkg/cheatsheet/generate.go +++ b/pkg/cheatsheet/generate.go @@ -73,6 +73,10 @@ func generateAtDir(cheatsheetDir string) { content = fmt.Sprintf("_This file is auto-generated. To update, make the changes in the "+ "pkg/i18n directory and then run `%s` from the project root._\n\n%s", CommandToRun(), content) writeString(file, content) + err = file.Close() + if err != nil { + log.Fatal(err) + } } }