3 ms·
Package management in Go is weird but it works well. You just run go mod tidy from time to time and you're good. Add a module proxy if you want to prevent issue
by thiht 4y ago
Package management in Go is weird but it works well. You just run go mod tidy from time to time and you're good. Add a module proxy if you want to prevent issues with repositories disappearing and you're gooder.
- gwd 4y agoThere's already a module proxy (pkg.go.dev) by default in new versions of Go, for just that purpose. In fact, one could argue that the automatic proxy is "Rube-Goldberg"-like: It works great normally, but if you need, for instance, to pull from a repo you just pushed to, you have to track down the magic rune to type to get `go get -u` to pull directly from your repo, rather than using the cached copy at pkg.go.dev.
- kardianos 4y agoIn go, if you just pushed to a repo a tagged version, say "v1.4.2", then you just specify "go get -u "myrepo.com/foo@v1.4.2". Internally it will fail to fetch from the moduel proxy, but then (by default) it will then look directly for the git repo, and it will still work. But you can also use go workspaces if you are co-developing modules in different repositories.
- thiht 4y ago> There's already a module proxy (pkg.go.dev) by default in new versions of Go, for just that purpose Is it really a proxy in this sense? I was under the impression that it did not keep cached copies of the code, just some metadata, so that it didn't actually protect about someone removing their repo. Maybe I'm wrong about that though.
- gwd 4y ago> so that it didn't actually protect about someone removing their repo. My impression, particularly based on the timing, was that the introduction of the proxy was in part directly in response to the "left-pad" fiasco. One thing it will also do is automatically publish your docs, if it can detect an open-source license. That would certainly require keeping a copy around.