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/vet: go vet not supporting vendoring #15182

Closed
yonderblue opened this issue Apr 7, 2016 · 4 comments
Closed

cmd/vet: go vet not supporting vendoring #15182

yonderblue opened this issue Apr 7, 2016 · 4 comments

Comments

@yonderblue
Copy link

Please answer these questions before submitting your issue. Thanks!

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

1.6

  1. What operating system and processor architecture are you using (go env)?

linux amd64

  1. What did you do?

vendor a package into another. run 'go tool vet -v thepkg/thefile.go'

  1. What did you expect to see?

Any vet reports.

  1. What did you see instead?

Missing reports when compared to having the vendored lib in the gopath like normal. Also see in the output, something like:

vet: ./internal/httpserver/httpserver.go:13:2: could not import github.com/rs/cors (can't find import: COMPANYSPECIFIC/vendor/github.com/rs/cors)

which is not the case if the dependency is in the gopath.

Another user with the same thing on the mailing list and me whining in the thread :)
https://groups.google.com/forum/#!searchin/golang-nuts/vet$20vendor/golang-nuts/uTcfZ15Ks0U/XBOXyfVPAQAJ

Thanks!

@bradfitz bradfitz changed the title go vet not supporting vendoring cmd/vet: go vet not supporting vendoring Apr 9, 2016
@bradfitz bradfitz added this to the Unplanned milestone Apr 9, 2016
@bradfitz
Copy link
Contributor

bradfitz commented Apr 9, 2016

I think this might only work at the package level, not files.

/cc @robpike @dsymonds

@yonderblue
Copy link
Author

using without going through tool swallows errors, so is there a way to find out? It seems consistent that the error given from going through tool is what is causing the missing vet reports when not going through tool.

@robpike
Copy link
Contributor

robpike commented Apr 10, 2016

Given just the file, it can't do the imports necessary to do the full job, and lacking the imports will lack the vendored imports. Try go tool vet -v thepkg. If that doesn't work, call in a vendoring expert.

@gopherbot
Copy link

Change https://golang.org/cl/74750 mentions this issue: cmd/go: pass package config to vet during "go vet"

@golang golang locked and limited conversation to collaborators Nov 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants