Doing rm -rf /pkg/.. blindly isn't nice. It could have
unintended consequences.
Secondly set bash to abort on (unexpected) errors.
R=dho, rsc
CC=golang-dev
https://golang.org/cl/176056
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
+set -e
+
+if [ -z "$GOROOT" ] ; then
+ echo '$GOROOT not set'
+ exit 1
+fi
+
GOBIN="${GOBIN:-$HOME/bin}"
rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH