From 97b5faee4a4063494aeaa8cf58c12436c27d1b5c Mon Sep 17 00:00:00 2001 From: spark Date: Wed, 15 Jan 2025 13:01:12 +0800 Subject: [PATCH] =?UTF-8?q?refactor(app):=20=E4=BC=98=E5=8C=96=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=89=98=E7=9B=98=E7=9B=B8=E5=85=B3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除了 systray.Run 函数的冗余 goroutine - 删除了多余的空行,提高了代码可读性 --- app.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.go b/app.go index 5668a67..9869b6e 100644 --- a/app.go +++ b/app.go @@ -41,7 +41,7 @@ func (a *App) startup(ctx context.Context) { a.ctx = ctx // 创建系统托盘 - go systray.Run(func() { + systray.Run(func() { onReady(a) }, func() { onExit(a) @@ -430,7 +430,6 @@ func onReady(a *App) { systray.SetIcon(icon2) systray.SetTitle("go-stock") systray.SetTooltip("go-stock 股票行情实时获取") - // 创建菜单项 show := systray.AddMenuItem("显示", "显示应用程序") //hide := systray.AddMenuItem("隐藏", "隐藏应用程序")