package module
import "cmd/go/internal/module"
Package module defines the module.Version type along with support code.
Index ¶
- func Check(path, version string) error
- func CheckPath(path string) error
- func MatchPathMajor(v, pathMajor string) bool
- func SplitPathVersion(path string) (prefix, pathMajor string, ok bool)
- type Version
Functions ¶
func Check ¶
Check checks that a given module path, version pair is valid. In addition to the path being a valid module path and the version being a valid semantic version, the two must correspond. For example, the path "yaml/v2" only corresponds to semantic versions beginning with "v2.".
func CheckPath ¶
CheckPath checks that a module path is valid.
func MatchPathMajor ¶
MatchPathMajor reports whether the semantic version v matches the path major version pathMajor.
func SplitPathVersion ¶
SplitPathVersion returns prefix and major version such that prefix+pathMajor == path and version is either empty or "/vN" for N >= 2. As a special case, gopkg.in paths are recognized directly; they require ".vN" instead of "/vN", and for all N, not just N >= 2.
Types ¶
type Version ¶
A Version is defined by a module path and version pair.
Source Files ¶
- Version
- v1.11.0-beta.1
- Published
- Jun 26, 2018
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 55 seconds ago –
Tools for package owners.