Go CLI Modules and Workspaces/Control allowed VCS

Restrict version control systems used for module fetches.

Section: Private Modules

Control allowed VCS

bash
bash
go env -w GOVCS=github.com:git,private:all
Explanation

Restrict version control systems used for module fetches. Useful in Go CLI workflows.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Private Modules
Set GOPRIVATE
Mark private module path patterns.
OpenIn sheetbashsame section
Set GONOPROXY
Bypass proxy for selected module path patterns.
OpenIn sheetbashsame section
Set GONOSUMDB
Skip checksum database for selected private modules.
OpenIn sheetbashsame section
Initialize module
Create a new go.mod for the current project.
OpenIn sheetbash1 tag match
Add replace directive
Point a module dependency to a local checkout.
OpenIn sheetbash1 tag match
Upgrade dependency
Update a dependency to the latest version.
OpenIn sheetbash1 tag match