I came back to golang after a while, and tried to troubleshoot an open source library.
When I tried to install its dependencies, and even when my IDE (VSCode) tried to install the current language server, I would get errors like the following:
$ go install -v golang.org/x/tools/gopls@latest
go: golang.org/x/tools/gopls@latest: module golang.org/x/tools/gopls: reading https://gocenter.io/golang.org/x/tools/gopls/@v/list: 405 Not Allowed
In an attempt to troubleshoot this, I created another user on my machine and the dependency installation worked when I used that user account.
What is going on?
Why can I no longer install any package with go?
The go module system can use a proxy protocol to fetch dependencies. The proxies that are being used are controlled by go's
GOPROXYenvironment variable.Its default value in the past likely included
goceter.io, which was a service offered by JFrog and was discontinued at some point.In my case, it was being set in the file pointed by
go env GOENV, and removing this domain (and others) from the file contents made everything work again.