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
When you run commands like go install, go build, or go run, the go command will automatically download the remote module and record its version in your go.mod file
However, the example failed:
$ go install example.com/user/hello
hello.go:6:2: no required module provides package github.com/google/go-cmp/cmp; to add it:
go get github.com/google/go-cmp/cmp
What did you expect to see?
I expected the behaviour to match the guide.
What did you see instead?
An error. I've solved it by running go mod tidy. (By the way, it would be nice if go install output would mention go mod tidy too.)
The text was updated successfully, but these errors were encountered:
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 was following the guide at https://golang.org/doc/code. It says:
However, the example failed:
What did you expect to see?
I expected the behaviour to match the guide.
What did you see instead?
An error. I've solved it by running
go mod tidy
. (By the way, it would be nice ifgo install
output would mentiongo mod tidy
too.)The text was updated successfully, but these errors were encountered: