package modcmd
import "cmd/go/internal/modcmd"
Package modcmd implements the “go mod” command.
Index ¶
- Variables
- func DownloadModule(ctx context.Context, f *modfetch.Fetcher, m *ModuleJSON) error
- func RunVendor(loaderstate *modload.State, ctx context.Context, vendorE bool, vendorO string, args []string)
- type ModuleJSON
Variables ¶
var CmdMod = &base.Command{ UsageLine: "go mod", Short: "module maintenance", Long: "" /* 316 byte string literal not displayed */, Commands: []*base.Command{ cmdDownload, cmdEdit, cmdGraph, cmdInit, cmdTidy, cmdVendor, cmdVerify, cmdWhy, }, }
Functions ¶
func DownloadModule ¶
DownloadModule runs 'go mod download' for m.Path@m.Version, leaving the results (including any error) in m itself.
func RunVendor ¶
func RunVendor(loaderstate *modload.State, ctx context.Context, vendorE bool, vendorO string, args []string)
Types ¶
type ModuleJSON ¶
type ModuleJSON struct {
Path string `json:",omitempty"`
Version string `json:",omitempty"`
Query string `json:",omitempty"`
Error string `json:",omitempty"`
Info string `json:",omitempty"`
GoMod string `json:",omitempty"`
Zip string `json:",omitempty"`
Dir string `json:",omitempty"`
Sum string `json:",omitempty"`
GoModSum string `json:",omitempty"`
Origin *codehost.Origin `json:",omitempty"`
Reuse bool `json:",omitempty"`
}
A ModuleJSON describes the result of go mod download.
Source Files ¶
download.go edit.go graph.go init.go mod.go tidy.go vendor.go verify.go why.go
- Version
- v1.26.0
- Published
- Feb 10, 2026
- Platform
- linux/amd64
- Imports
- 31 packages
- Last checked
- 3 minutes ago –
Tools for package owners.