Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: document that module names without dots are reserved #32819
Intuitively, most Go developers publish Go code under import paths like
However, some have avoided the
For example, I recall a recent issue in this tracker (which I can't find now!) where their GOPATH build broke when upgrading the Go version, as the root path element was
However, this separation isn't well documented anywhere. Even if we consider it as a warning or recommendation more than a strict rule, I think we should still mention it somewhere.
I also think we should encourage the use of
Another advantage of strongly encouraging the use of
Note that this doesn't need to change how
Another small detail. It's not correct to say "all import paths without dots are reserved by the standard library", because there are a few counter-examples. Use
I'm also a bit surprised that the two commands above give different package paths. I think that's counter-intuitive, but maybe there's a good reason for it.