Saturday, December 20, 2014

Golang Update to 1.4 Went NOPE (Error!)

I recently tried to update my Go installation from source only to have it fail. Fortunately the fix was simple, and the error message was surprisingly helpful.

me@mysystem ~/go/src $ ./all.bash
# Building C bootstrap tool.
cmd/dist

# Building compilers and Go bootstrap tool for host, linux/arm.
go tool dist:

The Go package sources have moved to $GOROOT/src.
*** /home/me/go/src/pkg still exists. ***
It probably contains stale files that may confuse the build.
Please (check what's there and) remove it and try again.
See http://golang.org/s/go14nopkg

It even included a link to the explanation page!

I didn't have anything of consequence in that directory. It was as simple as

rm -rf $GOROOT/src/pkg

...then re-running the compile script. As a beginner just playing around, it was simple. If you actually have projects with stashes of stuff in that directory, copy the ones you want to another location and then delete stuff and re-run the script.

If nothing else, this is a reminder that Go is an evolving language and is going through a mildly turbulent tween years on its way to adulthood.

No comments:

Post a Comment