When trying to lookup some modules, I am having an issue from VS Code where the error pictured below indicates that my GOPROXY is set to off, but when I run go env
, I see that GOPROXY is actually set:GOPROXY="https://repo1.mycompany.com/artifactory/api/go/golang-virtual,https://proxy.golang.org,direct"
I have tried setting GONOPROXY=''
, as this comment suggests, but after running export GONOPROXY=
or export GONOPROXY=""
, and checking go env in a new terminal tab, GONOPROXY is still set to: GONOPROXY="*.mycompany.com"
Running go mod tidy
as VS Code suggests, results in the same error message.
Is it possible that my go env values are being set somewhere that I don't know about, maybe a different version of Go's env vars? Thanks in advance, any help is greatly appreciated.
VS Code's error screenshot:
Simply Ctrl + Shift + P
> Developer: Reload window
The latest docs have updated the GOPROXY
flag proxy.golang.org, which states:
To opt-out of this module mirror, you can turn it off by setting GOPROXY=direct
So to bypass the proxy and fetch directly from the URLs in go.mod:
export GOPROXY=direct
go clean --modcache
go get -u
go build
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With