From 49b1c0bb5da2854af0198eb3c20e3fb1e3f2258b Mon Sep 17 00:00:00 2001 From: guangwu Date: Thu, 23 May 2024 17:56:42 +0800 Subject: [PATCH] fix: close file --- internal/logging/crash.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/logging/crash.go b/internal/logging/crash.go index 15f3ea3f..27da9e1b 100644 --- a/internal/logging/crash.go +++ b/internal/logging/crash.go @@ -37,6 +37,7 @@ func DumpStackTrace(logsPath string, sessionID SessionID, appName AppName) crash if err != nil { return err } + defer f.Close() if _, err := f.WriteString(fmt.Sprintf("Recover: %v", r)); err != nil { return err