News for hackers. Stuff that matters.
Re:Python Is Easy. Go Is Simple. Simple != Easy by distortedsignal on Monday November 27, 2023 @01:15PM (#38435896)
Ok, I wasn’t able to figure that out when I was in the codebase.

What do you do if you’re working in a fork of the project and you need to make those changes?

Re:Python Is Easy. Go Is Simple. Simple != Easy by Groxx on Monday November 27, 2023 @01:27PM (#38436091)
Should be the same. You can replace to any location, and with modules it doesn't even need to follow GOPATH naming conventions.

E.g. clone A and fork-B into adjacent folders regardless of fork status or import paths, and change A/go.mod to include

   replace original.com/B ../B
and that should work fine.

With GOPATH you would need to clone the fork into the original path. Which you can do if needed / modules don't prevent that either, but modules don't need any specific locations at all.

---

The official module doc is... huge and doesn't spell things out in an easily-usable form, so you're far from alone in your confusion, but I do think it's worth reading. I routinely find people spending way more time struggling with them than it would take to read the spec and become an expert on it: https://go.dev/ref/mod

Re:Python Is Easy. Go Is Simple. Simple != Easy by distortedsignal on Monday November 27, 2023 @04:23PM (#38438535)
Wow. You’re right - that is simpler than I expected. Thank you!