add support for general package negation to cmd/go. e.g.
go install -a all -std
should do the right thing (actually, not quite, see below).
yes, this is more work, but it's also a new general capability that could
be useful in other scenarios, not limited to just ignoring std packages.
And it avoids adding new options to the Go tool. The only problem
besides implementation complexity is what if a package import starts
with a dash. And in that case, we can use !, which is allowed to be
(Choosing ! has the unpleasant effect that it collides with shell history
expansion meta-character, but that's not a big issue, just quote/escape
the ! character.)
And then we can restore the -a flag, and advise people of binary distribution
to use go install -a all -std to rebuild all their packages.
Rationale for this is that no only std packages need special treatment,
some packages (commands) in x/tools also need to be skipped because
they are also intended to be installed into $GOROOT (godoc, cover, vet,
for example), so the full command line should be:
Having this general mechanism will save us the trouble should we introduce
more special commands into the tools sub-repo in the future.