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: 'go vet cmd' fails with "use of internal package" when run in GOROOT/src/cmd #42235

bcmills opened this issue Oct 27, 2020 · 0 comments


Copy link

@bcmills bcmills commented Oct 27, 2020

~/go-review/src/cmd$ go version
go version devel +320cc79002 Tue Oct 27 12:36:54 2020 +0000 linux/amd64

~/go-review/src/cmd$ go vet cmd
package cmd/vendor/
        vendor/ use of internal package not allowed
package cmd/vendor/
        vendor/ use of internal package not allowed

~/go-review/src/cmd$ cd ..

~/go-review/src$ go vet cmd


I'm not actually sure whether this bug is in cmd/go or in cmd/vet.

There was a similar issue (#41358) in cmd/api which we resolved by omitting the vendored packages. However, in this case I think we really should be running vet on these packages — we just need to get go vet to interpret the imports from within those packages correctly.

This comment in cmd/go is related:

// Do the same for importers beginning with the prefix 'vendor/' even if we
// are *inside* of the 'std' module: the 'vendor/' packages that resolve
// globally from GOROOT/src/vendor (and are listed as part of 'go list std')
// are distinct from the real module dependencies, and cannot import
// internal packages from the real module.

CC @matloob @jayconrod

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants