module

package standard library
go1.11beta1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2018 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package module defines the module.Version type along with support code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(path, version string) error

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

func CheckPath(path string) error

CheckPath checks that a module path is valid.

func MatchPathMajor

func MatchPathMajor(v, pathMajor string) bool

MatchPathMajor reports whether the semantic version v matches the path major version pathMajor.

func SplitPathVersion

func SplitPathVersion(path string) (prefix, pathMajor string, ok bool)

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

type Version struct {
	Path    string
	Version string
}

A Version is defined by a module path and version pair.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL