-
Notifications
You must be signed in to change notification settings - Fork 18k
x/website: tutorial create a module, cannot find package "example.com/greetings" #42871
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
Comments
@reevelau
If you would like to create the directory structure,
I hope this helps you. |
I agree that the tutorial should work as it is and you shouldn't need to Suggestion: try to re-do the tutorial from scratch. If you still get that error, post your directory structure like @task4233 did above, and the content of all the files; and we may be able to understand what went wrong. |
I was doing the tutorial in |
I am trying to follow the tutorial from "https://golang.org/doc/code#Workspaces" and I am getting: hello.go:6:2: cannot find package In no place there is a mention that a $GOPATH/src has to be created. What is more I don't find a folder named example.com/user/hello. Where I supposed to be. ? go version go1.16.5 linux/amd64 in Ubuntu 20 |
@sylviankahane It doesn't need to exist, you probably missed a step 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 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?
I am trying to follow the tutorial to create and reference it in
hello.go
. The source code ofhello.go
can be found in the next page, call-module-code.But when I execute
go run hello.go
the process failed with error message. To workaround the issue, I need to deleteexample.com/
beforegreetings
. I double checked the context of the tutorial, there isn't a hint of creating directory structureexample.com/greetings
butgreetings
. I don't know whether it was working in the older version of go.May be creating the structure like this, before creating the
go.mod
, would smooth the experience of the tutorialWhat did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: