If you've ever sat through a demo where go get
decided to time out at the worst possible moment, you understand why Go proxies exist. Before Go 1.13, dependency management was basically Russian roulette. Half the time it worked, the other half you'd get "connection timeout" or "repository not found" because someone moved their GitHub repo or you hit rate limits. Fun times.
Then proxy.golang.org became the default and suddenly builds stopped breaking every time someone deleted a tag. Here's what actually happens now:
- You run
go get github.com/some/module@v1.2.3
- Go checks the proxy first (usually proxy.golang.org)
- If it's cached there, you get it in under 100ms
- If not, the proxy fetches it from GitHub and caches it forever
- Everyone else gets the cached version instantly
The Real Benefits (not marketing BS)
- No more vanishing dependencies: Once a version is in the proxy, it's permanent. Even if the author deletes their repo in a rage, your builds still work.
- Faster builds: Local cache means no waiting for GitHub's servers to wake up
- Corporate firewall friendly: Your company probably blocks direct Git access anyway
- Checksum verification: The checksum database ensures nobody swapped malicious code into your dependencies
When Things Go Wrong (and they will)
I've seen proxy.golang.org return 410 Gone
for retracted versions, which breaks builds until you figure out the version was pulled. The error message is cryptic: "module not found" when it really means "this version was marked as broken by the author."
Another fun one: private repos. If you don't set GOPRIVATE=github.com/yourcompany/*
, Go tries to fetch your secret internal modules through the public proxy, which obviously fails. Took me 2 hours to figure that out the first time.
Athens vs Public Proxy
Athens is what you run when proxy.golang.org isn't enough. It's basically your own proxy that can handle private modules and cache everything locally. The documentation is actually decent, which is rare.
Grab Engineering has a good writeup about why they switched to Athens for their monorepo. TLDR: proxy.golang.org was too slow for their CI/CD pipeline.
Other companies like Xendit also document their proxy setups. The pattern is always the same: start with proxy.golang.org, realize it's not enough for enterprise needs, switch to Athens.
GitHub itself has issues with proxy timeouts, so you're not alone if builds randomly fail with "fetch timed out". The Go team acknowledges this is a problem but the solution is running your own proxy.
Configuration That Actually Works
export GOPROXY=https://proxy.golang.org,direct
export GOSUMDB=sum.golang.org
export GOPRIVATE=github.com/yourcompany/*
The direct
fallback means if all proxies fail, Go downloads from Git directly. Without it, your build dies completely when proxies are down.
For debugging proxy issues, check the official Go modules wiki and Stack Overflow Go modules tag where people actually solve real problems, not the sanitized documentation.
Anyway, here's what people actually ask when their builds start failing.