Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: confusing error on mod edit -replace=old=.. #30514

mvdan opened this issue Mar 1, 2019 · 1 comment

cmd/go: confusing error on mod edit -replace=old=.. #30514

mvdan opened this issue Mar 1, 2019 · 1 comment
modules NeedsInvestigation


Copy link

@mvdan mvdan commented Mar 1, 2019

What version of Go are you using (go version)?

go version devel +44d3bb998c Fri Mar 1 07:45:00 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?


What did you do?

$ mkdir test
$ cd test
$ go mod init test
go: creating new go.mod: module test
$ go mod edit
go mod: invalid new path: malformed module path "..": double dot
$ go mod edit
$ cat go.mod
module test

go 1.13

replace => ../

What did you expect to see?

Replacing a module to .. would either succeed or give a useful error.

What did you see instead?

An error saying "double dot", which makes no sense to me as a user. It was @myitcv who pointed out that adding a trailing slash would fix the problem.

From go help go mod:

If the @v in new@v is omitted, the new path hould be a local module root directory, not a module path.

So nothing in the error nor the docs seemed to point me at the missing slash.

/cc @bcmills

@mvdan mvdan changed the title cmd/go: confusing error on edit -replace=old=.. cmd/go: confusing error on mod edit -replace=old=.. Mar 1, 2019
@mvdan mvdan added the modules label Mar 1, 2019
@bcmills bcmills added the NeedsInvestigation label Mar 1, 2019
Copy link

@bcmills bcmills commented Mar 1, 2019

Possibly related to #27299.

CC @jayconrod

@bcmills bcmills added this to the Go1.13 milestone Mar 1, 2019
@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@andybons andybons added this to the Go1.14 milestone Jul 8, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
modules NeedsInvestigation
None yet

No branches or pull requests

4 participants