Skip to content

go_dependencies

Imports a locked, vendored Go module graph.

Description

The resolver reads go.mod or a Go workspace, declared checksum files, and vendor/modules.txt. It creates one queryable go_module target per selected external module. Ordinary build actions use the vendor tree with network module lookup disabled.

Attributes

AttributeTypeRequiredDefaultDescription
manifeststringnogo.modPackage-relative module manifest
workspace_filestringnoemptyPackage-relative go.work file for a multi-module workspace
sum_fileslist<string>no["go.sum"]Checksum files authenticating selected module sources
vendor_dirstringnovendorPackage-relative directory produced by go mod vendor or go work vendor
resolver_inputslist<string>nosrcsManifest, checksum, workspace, and vendor manifest files supplied to the resolver
_go_resolvedboolresolver-ownedfalseMarks a dependency set expanded by the resolver
_go_module_targetslist<string>resolver-owned[]Names of generated module targets

Dependency Edges

EdgeAcceptsDescription
depsgo_moduleGenerated locked modules aggregated by this dependency set

Providers and Capabilities

The target emits go_dependency_set and exposes build with no output group.

Example

toml
[[target]]
name = "GoDependencies"
kind = "go_dependencies"
srcs = ["go.mod", "go.sum", "vendor/modules.txt"]

[target.attrs]
resolver_inputs = ["go.mod", "go.sum", "vendor/modules.txt"]

See the Go guide for the update and vendoring workflow.

Released under an open-source license.