-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/pkgsite: Tutorial should tell you to start in $GOPATH #60035
Comments
Thanks for the report. Creating What was the command you ran that failed and its full output? |
@dmitshur The issue comes after creating two modules: The error was in my Also worth noting that cmd+clicking that imported |
@dmitshur My projects/golang/hello λ go env |
The poor error message is because a dotless prefix considered reserved for the standard library, if you followed the tutorial and used Without seeing a full directory tree and the contents of your files, it's hard to say what's wrong, but I don't think this a problem of the tutorial. Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only. For questions please refer to https://github.com/golang/go/wiki/Questions |
What is the URL of the page with the issue?
https://go.dev/doc/tutorial/create-module
Description
I'm brand new to Go and am following along with the tutorial.
The tutorial doesn't make any mention by this point (creating a module) of $GOPATH or $GOROOT, which I've learned is where these examples really need to live so that each module can resolve without needing to symlink to somewhere else on my system.
Without this information, and having created the tutorial code exactly as instructed, it leads to errors not being able to find modules where it looks by default, $GOPATH and $GOROOT.
This is the current tutorial instruction for where to create code:
It should tell us to create a
user/go/src/example/hello
dir, no? This way in the next steps we're able to create asrc/greetings
dir.Have I overlooked something, or is this information that should be included in the documentation?
Seems fixable with a brief addition about where to create the tutorial work (and all future work, according to the opinions of some, though I'm not sure on common practices here). In the $GOPATH.
I'm happy to open a PR adding that to the docs if I am understanding this correctly.
The text was updated successfully, but these errors were encountered: