From 4ff02d4a806745a6c7c2352031ff260304a7e165 Mon Sep 17 00:00:00 2001 From: dailz Date: Fri, 10 Apr 2026 08:48:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=20main()=20=E4=B8=AD?= =?UTF-8?q?=E5=A4=9A=E4=BD=99=E7=9A=84=20defer=20application.Close()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Run() 在所有退出路径中已调用 Close(),main 中的 defer 是冗余的。 Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- cmd/server/main.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/server/main.go b/cmd/server/main.go index 5a7ab98..ef26a18 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -33,8 +33,6 @@ func main() { if err != nil { zapLogger.Fatal("failed to initialize application", zap.Error(err)) } - defer application.Close() - if err := application.Run(); err != nil { zapLogger.Fatal("application error", zap.Error(err)) }