I reproduced the issue with:
- calling the 1.1.2
go.exe directly (I didn't have
%GOROOT%\bin in my path)
GOROOT pointing to the previous 1.1.1 installation folder (I kept go 1.1.1 and 1.1.2 installed in separated folders).
If you are sticking with the default go setup (ie: one
C:\go installation directory, and
%GOROOT%\bin in your
PATH), you won't see this error.
But if you do see this error:
- make sure
%GOROOT% is consistent with the
go.exe you are calling
go install -a as explained below. The
go clean mentioned below won't be necessary.
As jnml comments:
the Go build system is supposed to figure out any obsolete stuff in
$GOPATH/pkg and (transitively) rebuild it on demand.
In the "Remove object files" section of "Command go" page, I missed the
go clean -i option:
-i flag causes clean to remove the corresponding installed archive or binary (what 'go install' would create).
.a file (like hopwatch.a) are precisely what go install generates for libraries (in Windows).
So the full clean command, to make sure go rebuild everything, would be:
go clean -r -i
go install -a
That will rebuild and install everything, including all dependent packages.
-a is actually a build option, which forces rebuilding of packages that are already up-to-date.
go clean -r -n would show you what would be cleaned (
-n: preview option).
It doesn't hurt to be sure of what will be deleted... before actually deleting anything.