You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ cd$(mktemp -d)
$ go mod init example/m
go: creating new go.mod: module example/m
$ go get [email protected]
go: downgraded go 1.21.0 => 1.20
$ echo"package main; func main() {}"> main.go
$ GOTOOLCHAIN=go1.20.7 go run .
ambiguous import: found package example/m in multiple modules:
example/m (/tmp/LpbXADzD)
(/Users/gopher/go/pkg/mod/golang.org/[email protected]/src/example/m)
$ echo$?
1
It works fine without toolchain selection, or if a dot is used in first path element.
I noticed because I usually type something short (i.e., without a dot in first path element) when running a throwaway program locally. I know import paths without a dot are reserved for the standard library and shouldn't be used, but example/... and test/... are reserved for user progams per #37641.