module

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2019 License: GPL-3.0 Imports: 4 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 CheckPath

func CheckPath(path string) error

CheckPath checks that a module path is valid.

func DecodePath

func DecodePath(encoding string) (path string, err error)

DecodePath returns the module path of the given safe encoding. It fails if the encoding is invalid or encodes an invalid path.

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 is usually a semantic version in canonical form.
	// There are two exceptions to this general rule.
	// First, the top-level target of a build has no specific version
	// and uses Version = "".
	// Second, during MVS calculations the version "none" is used
	// to represent the decision to take no version of a given module.
	Version string `json:",omitempty"`
}

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