I switched from go 1.6 to 1.4.2 for faster compilation. When I recompile the earlier compiled binary of 1.6, I get the following error:
import go/pkg/darwin_amd64/github.com/Sirupsen/logrus.a: object is
[darwin amd64 go1.6 X:none] expected [darwin amd64 go1.4.2 X:precisestack]
I have already tried go build -a
- which works without any error. And have also tried go install -a
and go build
- both of these commands throw the above mentioned error.
I already know that, if I delete by go/pkg
folder, then it will work. That is the answer of the already existing SO question
I wanted to know, if there is another way to resolve this using go tools, other than deleting the pkg
folder.
Most likely due to previous compiles. Just delete your $GOLANG/pkg and you are good to go!
another way to resolve this using go tools, other than deleting the pkg folder.
The go tool chain is unlikely to be modified to handle this corner use case.