|
| 1 | +// Package module is a thin forwarding layer on top of |
| 2 | +// [golang.org/x/mod/module]. Note that the Encode* and |
| 3 | +// Decode* functions map to Escape* and Unescape* |
| 4 | +// in that package. |
| 5 | +// |
| 6 | +// See that package for documentation on everything else. |
| 7 | +package module |
| 8 | + |
| 9 | +import "golang.org/x/mod/module" |
| 10 | + |
| 11 | +type Version = module.Version |
| 12 | + |
| 13 | +func Check(path, version string) error { |
| 14 | + return module.Check(path, version) |
| 15 | +} |
| 16 | + |
| 17 | +func CheckPath(path string) error { |
| 18 | + return module.CheckPath(path) |
| 19 | +} |
| 20 | + |
| 21 | +func CheckImportPath(path string) error { |
| 22 | + return module.CheckImportPath(path) |
| 23 | +} |
| 24 | + |
| 25 | +func CheckFilePath(path string) error { |
| 26 | + return module.CheckFilePath(path) |
| 27 | +} |
| 28 | + |
| 29 | +func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) { |
| 30 | + return module.SplitPathVersion(path) |
| 31 | +} |
| 32 | + |
| 33 | +func MatchPathMajor(v, pathMajor string) bool { |
| 34 | + return module.MatchPathMajor(v, pathMajor) |
| 35 | +} |
| 36 | + |
| 37 | +func CanonicalVersion(v string) string { |
| 38 | + return module.CanonicalVersion(v) |
| 39 | +} |
| 40 | + |
| 41 | +func Sort(list []Version) { |
| 42 | + module.Sort(list) |
| 43 | +} |
| 44 | + |
| 45 | +func EncodePath(path string) (encoding string, err error) { |
| 46 | + return module.EscapePath(path) |
| 47 | +} |
| 48 | + |
| 49 | +func EncodeVersion(v string) (encoding string, err error) { |
| 50 | + return module.EscapeVersion(v) |
| 51 | +} |
| 52 | + |
| 53 | +func DecodePath(encoding string) (path string, err error) { |
| 54 | + return module.UnescapePath(encoding) |
| 55 | +} |
| 56 | + |
| 57 | +func DecodeVersion(encoding string) (v string, err error) { |
| 58 | + return module.UnescapeVersion(encoding) |
| 59 | +} |
0 commit comments