You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected it to go out to Github, download the latest code from the main branch and install it.
In your go env the GOPROXY value is set to "https://proxy.golang.org,direct". That configuration means it first tries the Go module mirror (not GitHub), and falls back to direct only if the module mirror reports 404/410. See the first entry in the FAQ of https://proxy.golang.org/ for information about timing and caching of newly committed versions.
changed the title
go install: serving stale code from main branch
cmd/go, proxy.golang.org: go install serving stale code from main branch
Jun 3, 2022
I believe this is the default, so most people will have this configuration. Just noting that for the rest of my comment.
In order to improve our services' caching and serving latencies, new versions may not show up right away.
It sounds like it's working as expected, though I'd argue it's a poor user experience. It seems like the Go Proxy is trying to save on a request to Github for branches. This is unexpected when you compare it to other package managers like NPM.
Personally, I expect a proxy to be transparent, something I don't really need to think about. This design decision requires me to consider it. It's also not the first place you think to look.
Questions that came up while I was trying to figure this out:
"Is there something weird with my module cache? go install is finishing rather quickly... did it even check Github?"
Feel free to close if this decision is set in stone at this point, I think I'll be aware of this next time around. My hope is that Go Modules can reach the UX of NPM or Homebrew while still delivering on the promise of reproducible builds!