What do I do if compilation by using go build takes a long time?
If go build compilation takes a long time or is stuttering, you can use a proxy to accelerate compilation. Setting the GOPROXY environment variable routes module downloads through a faster proxy and resolves the issue.
Set GOPROXY for the current session
Export the variable before building:
export GOPROXY=https://goproxy.cnThen retry go build.