From e0ace157095521a1305f35bc8370d38db4b6e060 Mon Sep 17 00:00:00 2001 From: BroodjeAap Date: Mon, 30 Jan 2023 20:23:12 +0000 Subject: [PATCH] added some missing defer close() --- main.go | 2 ++ todo.md | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 70ab606..d09e4f0 100644 --- a/main.go +++ b/main.go @@ -541,6 +541,7 @@ func (web *Web) watchCreatePost(c *gin.Context) { c.AbortWithError(http.StatusBadRequest, err) return } + defer openedFile.Close() jsn, _ = ioutil.ReadAll(openedFile) } else { // selected one of the templates templateFiles, err := EMBED_FS.ReadDir("watchTemplates") @@ -1207,6 +1208,7 @@ func (web *Web) importWatch(c *gin.Context) { c.AbortWithError(http.StatusBadRequest, err) return } + defer openedFile.Close() jsn, _ := ioutil.ReadAll(openedFile) export := WatchExport{} diff --git a/todo.md b/todo.md index 69705b1..1638626 100644 --- a/todo.md +++ b/todo.md @@ -13,4 +13,3 @@ - ~~restore from upload~~ - browserless function filters - url path support -- defer formfile.close() \ No newline at end of file