cmd/go: relative replacements in a workspace are not resolved relative to their go.mod files #51204
Labels
FrozenDueToAge
GoCommand
cmd/go
NeedsFix
The path to resolution is known, but the work has not been done.
release-blocker
Milestone
What version of Go are you using (
go version
)?1.18beta2
Does this issue reproduce with the latest release?
What did you do?
Checkout the following repo:
https://github.com/jezell/gosync
run
go work sync
What did you expect to see?
expect the command to complete successfully
What did you see instead?
Suggested Fix
It appears that when checking for replacement conflicts, go work sync does not resolve relative replacement paths. While this may work for flat workspaces, this causes problems when module replacements are used within sub folders. Perhaps
go work sync
should resolve relative paths to absolute paths before performing its check for conflicts so that when two replacements point to exactly the same place the command doesn't fail.The text was updated successfully, but these errors were encountered: