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
{{ message }}
Repository navigation
cmd/compile: confusing message when go.mod file and vendor folder both present #44149
What exactly did you do, I can't reproduce the issue as described
Also note that names without a dot in the first element are considered reserved for the standard library, using a proper name gives a better error message
» mkdir /tmp/example &&cd /tmp/example
» go mod init example.com/foo
go: creating new go.mod: module example.com/foo
» cat <<EOF > main.gopackage mainimport _ "aaa"func main() {}EOF
» go build
main.go:3:8: package aaa is not in GOROOT (/home/arccy/sdk/gotip/src/aaa)
» mkdir vendor
» go build
main.go:3:8: cannot find package "." in:
/tmp/example/vendor/aaa
I don't think it's a problem? Without vendor/ a package with a name like aaa cannot be retrieved by standard tooling so it makes sense to report it as not found in GOROOT. With vendor/, which can be created by other tools, it is possible to use a package named like that
Activity
seankhliao commentedon Feb 7, 2021
What exactly did you do, I can't reproduce the issue as described
Also note that names without a dot in the first element are considered reserved for the standard library, using a proper name gives a better error message
dotaheor commentedon Feb 8, 2021
You exactly reproduced the error described above.
seankhliao commentedon Feb 8, 2021
I don't think it's a problem? Without
vendor/a package with a name likeaaacannot be retrieved by standard tooling so it makes sense to report it as not found inGOROOT. Withvendor/, which can be created by other tools, it is possible to use a package named like thatdotaheor commentedon Feb 8, 2021
OK, but shouldn't the message be
package "."confuses people.seankhliao commentedon Feb 8, 2021
that's #38748
dotaheor commentedon Feb 8, 2021
Looks so. Close it for that.