Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/go: 'go build ...' builds all packages in my homedir when using modules #31063
What version of Go are you using (
changed the title
cmd/go: go build ... builds all packages in my homedir when using modules
Mar 26, 2019
In Go 1.12.1, any
So this should fetch and build a lot of things.
That said, it shouldn't be scanning your entire laptop. Are you seeing this command build packages outside your repo that aren't published elsewhere? If so, can you narrow this down to a smaller test case we can look at?
Thanks for clarifying the behavior of
I admit that I didn't actually verify that it was the "entire laptop". I just know that it was hundreds of packages. Let me try to explain what I did a little clearer and you can tell me if this is intended behavior or not.
I was in a file structure like this:
I then ran
I then, bewildered, tried running
Is this expected behavior of
Thanks for your help!
What you're describing sounds like intended behavior, though I admit it's a little surprising at first.
In general, it is expected that
In GOPATH mode
Thanks for writing all that up. Very helpful! Is this behavior detailed in such a way somewhere in official help?
To parrot this back to you:
Thanks again for your help.
Not quite. What you're describing is the special
There's a bigger difference (covered above).
No extra work needed.
In GOPATH mode,
I'll close this issue because it seems like everything is working as intended, but feel free to reach out for more info on the golang-nuts mailing list or in the #modules channel on golang Slack.