Go: cmd/go/internal/get Index | Files

package get

import "cmd/go/internal/get"

Package get implements the “go get” command.


Package Files

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


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

func CheckImportPath Uses

func CheckImportPath(path string) error

CheckImportPath checks that an import path is valid.

type ImportMismatchError Uses

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 Uses

func (m ImportMismatchError) Error() string

type ModuleMode Uses

type ModuleMode int

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

const (
    IgnoreMod ModuleMode = iota

type RepoRoot Uses

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 Uses

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.

Package get imports 25 packages (graph) and is imported by 12 packages. Updated 2020-12-06. Refresh now. Tools for package owners.