cmd/go: mod init and mod edit unable to import module paths missing a dot #29620
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Overview and related issues
This issue seems to be related to #26510. But in this case, not the actual module I am working with is "dotless," but a dependency.
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?
Trying to initialize Go Modules with
go mod init
in a go package that has a “dotless” package dependency (package name “projectx”) which is to be downloaded from a location that cannot be deducted from the package name (might be an internal git server, etc.) configured usingglide.yaml
:(You can clone a the repo with this testcase from https://github.com./roblillack/my-internal-go-tool)
What did you expect to see?
I expected a
go.mod
being created like this:And this should have been the output of
go run .
:What did you see instead?
… and
go.mod
looks like this:This way, of course
go run .
does not work:Likewise, adding the dependency using
go mod edit
does not work, too:When creating/editing the require & replace actions in
go.mod
manually,go run .
will work as expected.The text was updated successfully, but these errors were encountered: