Description
This might actually be a bug in go, but I'm reporting it here anyway, since this breaks things here for now.
Recently, this library movied from sourcegraph to github. However, using the old sourcegraph.com name is now broken:
$ go get -d sourcegraph.com/sourcegraph/go-diff
go: sourcegraph.com/sourcegraph/[email protected]: parsing go.mod: unexpected module path "github.com/sourcegraph/go-diff"
go: error loading module requirements
The obvious fix is to just use the new github.com import path, but this is not always trivial. In particular, when go-diff is pulled in by a dependency that has the old url, running go get -u
to update dependencies fails with the same error.
I guess that the problem is that go does not gracefully support updating to a new version in this case and updating across a rename (so 0.5.0 -> 0.5.1) needs changing of the import path. I can't see an easy way to fix this on the go side of things, so perhaps the fix here is to have sourcegraph.com not publish the 0.5.1 release (only 0.5.0), though that would also mean that people might never realize they're using an outdated version...
(also, I couldn't actually find the code on sourcegraph.com anymore, http://sourcegraph.com/sourcegraph/go-diff gives a 404, but apparently go get still manages to access the files)