Skip to content

Commit

Permalink
module: forward to x/mod/module (#211)
Browse files Browse the repository at this point in the history
The golang.org/x/mod/module is now the canonical
location of this package.
  • Loading branch information
rogpeppe committed Mar 27, 2023
1 parent ca7ccbd commit d4265f6
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 858 deletions.
59 changes: 59 additions & 0 deletions module/forward.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Package module is a thin forwarding layer on top of
// [golang.org/x/mod/module]. Note that the Encode* and
// Decode* functions map to Escape* and Unescape*
// in that package.
//
// See that package for documentation on everything else.
package module

import "golang.org/x/mod/module"

type Version = module.Version

func Check(path, version string) error {
return module.Check(path, version)
}

func CheckPath(path string) error {
return module.CheckPath(path)
}

func CheckImportPath(path string) error {
return module.CheckImportPath(path)
}

func CheckFilePath(path string) error {
return module.CheckFilePath(path)
}

func SplitPathVersion(path string) (prefix, pathMajor string, ok bool) {
return module.SplitPathVersion(path)
}

func MatchPathMajor(v, pathMajor string) bool {
return module.MatchPathMajor(v, pathMajor)
}

func CanonicalVersion(v string) string {
return module.CanonicalVersion(v)
}

func Sort(list []Version) {
module.Sort(list)
}

func EncodePath(path string) (encoding string, err error) {
return module.EscapePath(path)
}

func EncodeVersion(v string) (encoding string, err error) {
return module.EscapeVersion(v)
}

func DecodePath(encoding string) (path string, err error) {
return module.UnescapePath(encoding)
}

func DecodeVersion(encoding string) (v string, err error) {
return module.UnescapeVersion(encoding)
}

0 comments on commit d4265f6

Please sign in to comment.