From 20e440f79ddd4ad00fef2e0fe9e98e7e0fe85b5c Mon Sep 17 00:00:00 2001 From: kingecg Date: Wed, 13 Dec 2023 23:07:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0close=20file=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- file.go | 1 + 1 file changed, 1 insertion(+) diff --git a/file.go b/file.go index cf023ce..d4c71f0 100644 --- a/file.go +++ b/file.go @@ -27,6 +27,7 @@ func (f *FileAppender) start() { } go func() { + defer f.file.Close() for { logEvent := <-f.lchan logMsg := format(logEvent)