Skip to content

Commit a354da8

Browse files
authored
semver: forward to x/mod/semver (#210)
This is now the canonical location of the semver package.
1 parent 6e5fb8c commit a354da8

File tree

3 files changed

+37
-570
lines changed

3 files changed

+37
-570
lines changed

semver/forward.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Package semver is a thin forwarding layer on top of
2+
// [golang.org/x/mod/semver]. See that package for documentation.
3+
package semver
4+
5+
import "golang.org/x/mod/semver"
6+
7+
func IsValid(v string) bool {
8+
return semver.IsValid(v)
9+
}
10+
11+
func Canonical(v string) string {
12+
return semver.Canonical(v)
13+
}
14+
15+
func Major(v string) string {
16+
return semver.Major(v)
17+
}
18+
19+
func MajorMinor(v string) string {
20+
return semver.MajorMinor(v)
21+
}
22+
23+
func Prerelease(v string) string {
24+
return semver.Prerelease(v)
25+
}
26+
27+
func Build(v string) string {
28+
return semver.Build(v)
29+
}
30+
31+
func Compare(v, w string) int {
32+
return semver.Compare(v, w)
33+
}
34+
35+
func Max(v, w string) string {
36+
return semver.Max(v, w)
37+
}

0 commit comments

Comments
 (0)