package get

import "cmd/go/internal/get"

Package get implements the “go get” command.

Index

Variables

var CmdGet = &base.Command{
	UsageLine: "go get [-d] [-f] [-t] [-u] [-v] [-fix] [-insecure] [build flags] [packages]",
	Short:     "download and install packages and dependencies",
	Long:      "" /* 2420 byte string literal not displayed */,
}
var HelpGopathGet = &base.Command{
	UsageLine: "gopath-get",
	Short:     "legacy GOPATH go get",
	Long: "" /* 275 byte string literal not displayed */+
		CmdGet.UsageLine + `
` + CmdGet.Long,
}
var (
	Insecure bool
)

Functions

func CheckImportPath

func CheckImportPath(path string) error

CheckImportPath checks that an import path is valid.

Types

type ImportMismatchError

type ImportMismatchError struct {
	// contains filtered or unexported fields
}

A ImportMismatchError is returned where metaImport/s are present but none match our import path.

func (ImportMismatchError) Error

func (m ImportMismatchError) Error() string

type ModuleMode

type ModuleMode int

ModuleMode specifies whether to prefer modules when looking up code sources.

const (
	IgnoreMod ModuleMode = iota
	PreferMod
)

type RepoRoot

type RepoRoot struct {
	Repo     string // repository URL, including scheme
	Root     string // import path corresponding to root of repo
	IsCustom bool   // defined by served <meta> tags (as opposed to hard-coded pattern)
	VCS      string // vcs type ("mod", "git", ...)
	// contains filtered or unexported fields
}

RepoRoot describes the repository root for a tree of source code.

func RepoRootForImportPath

func RepoRootForImportPath(importPath string, mod ModuleMode, security web.SecurityMode) (*RepoRoot, error)

RepoRootForImportPath analyzes importPath to determine the version control system, and code repository to use.

Source Files

discovery.go get.go path.go vcs.go

Version
v1.14.2
Published
Apr 8, 2020
Platform
darwin/amd64
Imports
26 packages
Last checked
2 minutes ago

Tools for package owners.