<p dir="auto">I have both go 1.3.3 and go 1.4 installed.</p>
<p dir="auto">I start by cleaning my $GOPATH/pkg directory.<br>
Running go test ./... with Go 1.4 completes successfully</p>
<p dir="auto">I clean my $GOPATH/pkg directory again.<br>
I set my PATH to point to Go 1.3.3<br>
Running go test ./... fails<br>
I end up with many errors all with the same error<br>
object is [darwin amd64 go1.4 X:precisestack] expected [darwin amd64 go1.3.3 X:precisestack]</p>
<p dir="auto">It seems to be a problem the moment you have an import in some other repo.  Almost like the updated PATH isn't being passed along.</p>
<pre class="notranslate">What steps will reproduce the problem?

I routinely use a handful of different go toolchains. As a result, I hit variants of
this error pretty frequently when building:

import &lt;...&gt;: object is [darwin amd64 devel +351b6fe0ae36 Tue Sep 24 15:54:48 2013
-0400 X:none] expected [darwin amd64 devel +dd18f98c9aa5 Thu Sep 26 21:35:49 2013 +1000
X:none]

To reproduce quickly:

1. Use one go version (say 1.1.2).
2. go test -i ./...
3. Switch to another go version (say tip).
4. go build ./...


Please provide any additional information below.

It's easy enough to fix the problem; remove the pkg directory, or build with -a.
However, the former is an annoyance and both make builds needlessly longer. (Is there
another option I have failed to find?)

Possible fixes include:

* Put the go toolchain version in the pkg directory (darwin_amd64_1.1.2 or
darwin_amd64_351b6fe0ae36). Optimizes for build speed at the cost of disk space and
directory ugliness.
* Instead of dying on mismatch, just discard the object, recompile, and keep on going.

I'd even suggest that this be considered for Go 1.2, since most users are likely to hit
this (albeit just once) when they upgrade.</pre>