-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
Module tutorial doesn't work for Go 1.16 #44457
Comments
See also #44241 (comment) |
Duplicate of #44241 |
The linked issue mentions that "go mod tidy" would fix the issue. It does not. Running it in both of the modules as well in parent directory has no effect on any files in these folders. |
@ValleZ No, the comment says that the user should ignore the "go mod tidy" message (i.e. not run it). |
Given that "go mod tidy" doesn't do anything I don't really understand how it's a duplicate besides "it fails" |
The issue that modules do not work and even simplest examples like that fail. |
@ValleZ Modules work, but the tutorial is broken in multiple ways and must be rewritten to reflect the changes in the module tools workflow with Go 1.16. |
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 followed steps from https://golang.google.cn/doc/tutorial/call-module-code
I created greetings folder with greetings.go file and run
go mod init example.com/greetings
what created go.mod with
then I created hello folder on the same level, hello.go
with
and go.mod with
then I run go build while in the hello folder and get error
hello.go:6:5: cannot find package
(I'm not sure how to run the code from hello folder in play.golang.org, but this mirrors the tutorial files)
https://play.golang.org/p/rtHtLMQHXUO
What did you expect to see?
The tutorial says I should see
go: found example.com/greetings in example.com/greetings v0.0.0-00010101000000-000000000000
What did you see instead?
hello.go:6:5: cannot find package
The text was updated successfully, but these errors were encountered: