-
Notifications
You must be signed in to change notification settings - Fork 266
增强语义版本支持 #146
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Activity
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Is your feature request related to a problem? Please describe.
g 没有充分利用语义版本信息,存在不便之处。例如我想从 1.20 切换到 1.22 ,但是不知道也不关心补丁版本,我期待的命令是
g use 1.22而不是g use 1.22.3。Describe the solution you'd like
构造一个哈希表,将忽略了小版本的版本号映射到小版本的最新版本,例如假设最新版本是 1.23.4 ,则
1和1.23都指向1.23.4。将用户输入经过哈希表转换再做后续操作,可以提升用户体验。
我用 Rust 写过一个 nodejs 的版本管理工具 nvm ,其中 src/semver.rs 包含了我的实现和测试,可以作为参考。
(我还不能用 Go 独立完成 😀)
nvm 利用语义版本信息简化输入示例:

Describe alternatives you've considered
Additional context