package
Version:
v1.3.2
Opens a new window with list of versions in this module.
Published: Mar 3, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Compare 比较两个 Version 的大小.
返回 -1 表示 a < b
返回 0 表示 a == b
返回 +1 表示 a > b
type Version struct {
Major, Minor, Patch int
}
Version 表示一个 major.minor.patch 格式的版本号.
Parse 解析 x, x.y, x.y.z 格式的字符串到 Version 对象, 如果成功 ok 为 true, 否则为 false.
Compare 比较 v 和 v2 的大小.
返回 -1 表示 v < v2
返回 0 表示 v == v2
返回 +1 表示 v > v2
String 将 Version 格式化成 major.minor.patch 的格式.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.