Skip to content
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

cmd/go: poor error message with '-mod=vendor' when loading a package that is not vendored #41936

Open
bcmills opened this issue Oct 12, 2020 · 0 comments
Labels
modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bcmills
Copy link
Contributor

bcmills commented Oct 12, 2020

(This issue is split out from #41916. #38748 is closely related.)

What version of Go are you using (go version)?

example.com$ go version
go version devel +9449a125e Sun Oct 11 17:54:59 2020 +0000 linux/amd64

What did you do?

go mod vendor
go list golang.org/x/tools/cmd/goimports

-- go.mod --
module example.com

go 1.16

require golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e
-- main.go --
package main

import _ "golang.org/x/tools/imports"

func main() {}

What did you expect to see?

An error message that explicitly mentions the user-provided path (golang.org/x/tools/cmd/goimports) the fact that that path is not vendored, and (perhaps) the fact that -mod=vendor is set by default because the vendor directory exists.

What did you see instead?

cannot find package "." in:
        /tmp/tmp.xYGlB041oB/example.com/vendor/golang.org/x/tools/cmd/goimports

CC @matloob @jayconrod

@bcmills bcmills added NeedsFix The path to resolution is known, but the work has not been done. modules labels Oct 12, 2020
@bcmills bcmills added this to the Backlog milestone Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

1 participant