Skip to content

cmd/go: document using 'go list' to download modules needed to build packages #38031

@jayconrod

Description

@jayconrod

go list -test ./... can be used to download the modules needed to build tests of the packages matched by ./.... This is usually a smaller set of modules than go mod download all (or equivalent go mod download) would select, so it's a useful command when building small Docker images.

This should be documented as a FAQ on https://github.com/golang/go/wiki/Modules.

Related #36460: fewer modules will be downloaded by go mod download all when lazy module loading is implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions