package
Version:
v1.0.0-rc.2
Opens a new window with list of versions in this module.
Published: Oct 5, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
func Compare(left, right string) (comparison int, comparable bool)
Compare 按 SemVer 2.0.0 比较版本,包括 prerelease 优先级。
只有两侧都合法时 comparable 才为 true。
Normalize 把产品版本规范成带 v 前缀的 SemVer。
返回 false 表示输入不是合法 SemVer;调用方不能再退化成字符串比较。
Source Files
¶
Click to show internal directories.
Click to hide internal directories.