malformed module path "xxx": missing dot in first path element - When path itself is missing #35343
Labels
FrozenDueToAge
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Per issue #34184, this is a specific case that causes this error.
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
)?Mac OS 10.14.6
What did you do?
I ran a test on code that had an import path like so:
import mypath/dir/subdir
This code is supposed to be run in a directory that has a go.mod file with a "replace" statement that directs "mypath" to a real directory on the computer, as in:
replace mypath/dir/subdir => ../myproject
However, I did not set that up yet in the go.mod file. Essentially this means that Go was trying to import a path that it could not resolve.
More specifically, here are reproducible steps:
main.go:
go.mod:
go run main.go
What did you expect to see?
Since I like errors that offer solutions when available, I like this:
malformed module path "a/b/c": Cannot resolve module path to a directory location. Either install the module, or use a replace statement in a go.mod file to direct it to a location on your disk.
What did you see instead?
cannot load a/b/c: malformed module path "a/b/c": missing dot in first path element
The text was updated successfully, but these errors were encountered: