mirror of
https://github.com/ArvinLovegood/go-stock.git
synced 2025-07-19 00:00:09 +08:00
feat(update):优化软件更新逻辑
- 增加对操作系统类型的判断,非 Windows 系统不执行更新 - 优化更新版本信息的传递方式 -重构代码,提高可读性和可维护性
This commit is contained in:
parent
2d224ccfc4
commit
c2f260c613
23
utils.go
Normal file
23
utils.go
Normal file
@ -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"
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user