refactor(updater): 重构 Go 版本更新器
- 更新项目名称为 AUTO_MAA_Go_Updater - 重构代码结构,优化函数命名和逻辑 - 移除 CDK 相关的冗余代码 - 调整版本号为 git commit hash - 更新构建配置和脚本 - 优化 API 客户端实现
This commit is contained in:
@@ -1,41 +1,19 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
var (
|
||||
// Version is the current version of the application
|
||||
// Version 应用程序的当前版本
|
||||
Version = "1.0.0"
|
||||
|
||||
// BuildTime is set during build time
|
||||
|
||||
// BuildTime 在构建时设置
|
||||
BuildTime = "unknown"
|
||||
|
||||
// GitCommit is set during build time
|
||||
|
||||
// GitCommit 在构建时设置
|
||||
GitCommit = "unknown"
|
||||
|
||||
// GoVersion is the Go version used to build
|
||||
|
||||
// GoVersion 用于构建的 Go 版本
|
||||
GoVersion = runtime.Version()
|
||||
)
|
||||
|
||||
// GetVersionInfo returns formatted version information
|
||||
func GetVersionInfo() string {
|
||||
return fmt.Sprintf("Version: %s\nBuild Time: %s\nGit Commit: %s\nGo Version: %s",
|
||||
Version, BuildTime, GitCommit, GoVersion)
|
||||
}
|
||||
|
||||
// GetShortVersion returns just the version number
|
||||
func GetShortVersion() string {
|
||||
return Version
|
||||
}
|
||||
|
||||
// GetBuildInfo returns build-specific information
|
||||
func GetBuildInfo() map[string]string {
|
||||
return map[string]string{
|
||||
"version": Version,
|
||||
"build_time": BuildTime,
|
||||
"git_commit": GitCommit,
|
||||
"go_version": GoVersion,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user