From c2f260c613e90620ef3e27af81e74db07833a299 Mon Sep 17 00:00:00 2001 From: ArvinLovegood Date: Tue, 8 Jul 2025 21:08:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(update):=E4=BC=98=E5=8C=96=E8=BD=AF?= =?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 增加对操作系统类型的判断,非 Windows 系统不执行更新 - 优化更新版本信息的传递方式 -重构代码,提高可读性和可维护性 --- utils.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 utils.go diff --git a/utils.go b/utils.go new file mode 100644 index 0000000..4f935bb --- /dev/null +++ b/utils.go @@ -0,0 +1,23 @@ +package main + +// @Author spark +// @Date 2025/7/8 18:51 +// @Desc +//----------------------------------------------------------------------------------- + +import "runtime" + +// IsWindows 判断是否为 Windows 系统 +func IsWindows() bool { + return runtime.GOOS == "windows" +} + +// IsMacOS 判断是否为 macOS 系统 +func IsMacOS() bool { + return runtime.GOOS == "darwin" +} + +// IsLinux 判断是否为 Linux 系统 +func IsLinux() bool { + return runtime.GOOS == "linux" +}