cmd/go: go.work: go build
requires versioned replace directive when replacing a used module with a local path
#54264
Labels
GoCommand
cmd/go
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Thinking
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Given the following workspace structure:
With the following
go.work
:Build
realdeal
which depends onfubar
:What did you expect to see?
Nothing, the build should succeed
What did you see instead?
Found workaround
The only way I've found to fix this is to update the
go.work
to be as follow:This is not needed if a workspace is not used. It also seems to contradict the example from the documentation (https://go.dev/ref/mod#workspaces):
The text was updated successfully, but these errors were encountered: