Skip to content

Commit fff40c6

Browse files
author
Sisyphus Agent
committed
feat: 始终显示完整版本信息
- 移除 dev 版本特殊处理逻辑 - 所有版本均显示 commit 和 build 日期信息 - 简化版本字符串格式化逻辑
1 parent 512e296 commit fff40c6

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

oho/cmd/main.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ func SetVersionInfo(ver, commit, date string) {
6464
commitStr = commit
6565
dateStr = date
6666

67-
if versionStr != "dev" {
68-
rootCmd.Version = fmt.Sprintf("%s (commit: %s, built: %s)", versionStr, commitStr, dateStr)
69-
} else {
70-
rootCmd.Version = versionStr
71-
}
67+
// 始终显示完整版本信息,包括 dev/dirty 版本
68+
rootCmd.Version = fmt.Sprintf("%s (commit: %s, built: %s)", versionStr, commitStr, dateStr)
7269
}
7370

7471
func main() {

0 commit comments

Comments
 (0)