News for hackers. Stuff that matters.
Re:Go's old $GOPATH story for development and dependencies by peter_l_downs on Friday May 24, 2024 @09:05AM (#40465809)
You can directly edit the downloaded code when using modules, you don’t need your go.work flow at all. I often do it while debugging particularly weird bugs or to better understand library code I’m using.
Re:Go's old $GOPATH story for development and dependencies by gwd on Friday May 24, 2024 @11:56AM (#40467443)
One way or another, the current workflow has to be:

1. Download the code (or update the copy you downloaded last time you had an issue)

2. Redirect `go build` to use the downloaded copy rather than the upstream copy (either by modifying go.mod or go.work)

3. Do the editing

4. Undo #2

Under the old system, you just had to do #3. And sure, it's not that much work, but it's a bit more than I had to do before.

Re:Go's old $GOPATH story for development and dependencies by peter_l_downs on Tuesday May 28, 2024 @10:23AM (#40501023)
You can just edit the copy that ‘go get / go build’ download to your system. Afterwards undo the edits or re-download the module to wipe out your edits. No need to use go.work, local replaces, or anything. The files are on your disk!
Re:Go's old $GOPATH story for development and dependencies by metaltyphoon on Friday May 24, 2024 @11:06AM (#40466978)
Its much better to do go.work and add to your ignore. This way you won’t have to muck with go.mod and commit the file with local replaces