Getting: go: error loading module requirements

12,621

Solution 1

Make sure you are using the latest Go 1.13.1.

If go mod tidy does not solve the issue, check that a simple go get github.com/gorilla/[email protected] works.

If it does not, it could be, as in this thread, a proxy configuration issue: it depends on your local environment, you might need to set a company proxy server to get anything.


Update August 2020: note that with Go 1.15:

The GOPROXY environment variable now supports skipping proxies that return errors.

Proxy URLs may now be separated with either commas (,) or pipe characters (|).

  • If a proxy URL is followed by a comma, the go command will only try the next proxy in the list after a 404 or 410 HTTP response.
  • If a proxy URL is followed by a pipe character, the go command will try the next proxy in the list after any error.

Note that the default value of GOPROXY remains https://proxy.golang.org,direct, which does not fall back to direct in case of errors.

Solution 2

It seems to be an issue with the GOPROXY set. What's the output of go env?

Share:
12,621

Related videos on Youtube

Author by

rchughtai

Updated on June 23, 2022

Comments

Related