MCPcopy Create free account
hub / github.com/V2RaySSR/RealityChecker / getVersionInfo

Function getVersionInfo

internal/ui/display.go:99–116  ·  view source on GitHub ↗

getVersionInfo 获取版本信息字符串

()

Source from the content-addressed store, hash-verified

97
98// getVersionInfo 获取版本信息字符串
99func getVersionInfo() string {
100 currentVersion := version.GetVersion() // 使用动态版本号
101
102 latestVersion := getLatestVersion()
103
104 if latestVersion == "" {
105 // 无法获取最新版本,只显示当前版本
106 return currentVersion
107 }
108
109 if latestVersion == currentVersion {
110 // 版本相同,只显示当前版本
111 return currentVersion
112 }
113
114 // 版本不同,显示当前版本和最新版本
115 return fmt.Sprintf("%s (最新: %s)", currentVersion, latestVersion)
116}
117
118// getDisplayWidth 计算字符串的显示宽度(中文字符占2个位置)
119func getDisplayWidth(s string) int {

Callers 1

PrintBannerFunction · 0.85

Calls 2

GetVersionFunction · 0.92
getLatestVersionFunction · 0.85

Tested by

no test coverage detected