Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
proposal: cmd/go: detect use of code outside current directory tree #22440
For many times, my project dependency packages are not placed in the vendor folder of my project.
So I proposal an option for these commands, to exclude all custom packages except the ones under pwd in building, so that I can find the missed vendor packages as early as possible. Currently, I must build my project in a docker container to achieve the goal. It is not very convenient.
For example, this is a file under my project root:
And here is another package "b" in the vendor folder which is directly under the project root folder.
A bare "go build" will succeed, even if the package "b" is not vendored, but it is under GOPATH/src.