What is GOPROXY?
I joined a new Go project. While building the local environment, I face this error message.
goproxy list is not the empty string, but contains no entries
In the first place, I didn’t know what the goproxy is.
What is GOPROXY?
Go installs modules from libraries, but they are subject to version changes. Therefore, it would be hard for us to avoid related bugs. Goproxy solves such problems. Goproxy gets in between modules and our projects and create cache. Our projects’ request to the modules are redirected to the cache, so projects can always refer to the same code.
How to use it
The way to use it is easy, All you have to do is just set up an environment variable like below.
export GOPROXY=https://proxy.golang.org
I could solve the error above by setting up the variable.