11 ms·
I'm just starting out with Go, but how has the official guide[1] failed you? Genuinely curious as it seems to cover both new installations and the management of
by usrme 4y ago
I'm just starting out with Go, but how has the official guide[1] failed you? Genuinely curious as it seems to cover both new installations and the management of multiple versions.
---
[1]: https://go.dev/doc/install https://go.dev/doc/install
- ses1984 4y agoWhat do you do if you're working on a go project and you need to fork one of its dependencies? Or the project you're working on is a fork? https://stackoverflow.com/questions/14323872/using-forked-package-import-in-go https://stackoverflow.com/questions/14323872/using-forked-pa... There are a lot of different approaches listed in here that have changed over time. Different projects evolve at different rates. You might need to become familiar with multiple old ways of dependency management to be really effective.
- CraigJPerry 4y agoNot a Go developer (but i really admire their devops-friendly toolchain and general ethos of keeping things simple). I went to https://go.dev/doc/ https://go.dev/doc/ I clicked on "Managing Dependencies" -> "Requiring external module code from your own repository fork" And arrived at: https://go.dev/doc/modules/managing-dependencies#external_fork https://go.dev/doc/modules/managing-dependencies#external_fo... Assuming that information is correct - and i'm not in a place to judge that, i just don't have the knowledge unfortunately - that journey felt pretty short and discoverable.
- ses1984 4y agoGo modules were apparently released right after I changed jobs and stopped using go at work. Apparently I’m remembering the old hell.
- p2detar 4y agoAre there really that many mainstream projects that use alternative dependency handling? Go modules were introduced in v1.11 and they seem pretty mature. The replace directive seems to solve the issues with forked projects in particular. [1] 1 - https://github.com/golang/go/wiki/Modules#when-should-i-use-the-replace-directive https://github.com/golang/go/wiki/Modules#when-should-i-use-...
- Philip-J-Fry 4y agoClone it, update the consumer go.mod with a "replace" directive to point the dependency at your fork. I don't understand how this is still a problem for people to understand. It's been the standard for literally years now. It's actually even better now that go workspaces are a thing.
- marwatk 4y agoI haven't messed with them yet but 1.18 add workspaces [1] This is definitely a pain point I've had with golang and the 'accepted' process has changed 3 or 4 times in the last 2 years. 1: https://go.dev/doc/tutorial/workspaces https://go.dev/doc/tutorial/workspaces
- icholy 4y ago> the 'accepted' process has changed 3 or 4 times in the last 2 years. No it hasn't.
- martinskou 4y agoOr use vendoring: https://go.dev/ref/mod#vendoring https://go.dev/ref/mod#vendoring