-echo Installing $GOLANG_LOCAL
-mkdir -p ${GOLANG_UNTAR}/
-# --strip-components isn't portable, switch to portable version by performing move step after untar
-tar xf ${GOLANG_LOCAL} -C ${GOLANG_UNTAR}/ #--strip-components=1
-mv ${GOLANG_UNTAR}/go/* ${GOLANG_UNTAR}/
-rm -rf ${GOLANG_UNTAR}/go # clean up the temporary unzip folder
-if [ -n "$(command -v rsync 2>/dev/null | grep rsync)" ]; then
- echo $sudo_cmd rsync -Krl "${GOLANG_UNTAR}/" "$golang_install_path/"
- rsync -Krl "${GOLANG_UNTAR}/" "$golang_install_path/" 2>/dev/null || $sudo_cmd rsync -Krl "${GOLANG_UNTAR}/" "$golang_install_path/"
-else
- echo $sudo_cmd cp -Hr "${GOLANG_UNTAR}/*" "$golang_install_path/"
- cp -Hr "${GOLANG_UNTAR}"/* "$golang_install_path/" 2>/dev/null || $sudo_cmd cp -Hr "${GOLANG_UNTAR}"/* "$golang_install_path/"
-fi
-rm -rf "${GOLANG_UNTAR}"
-
-#######
-# END #
-#######
-
-# TODO add more than one at a time
-pathman add $golang_install_path/bin
-mkdir -p $HOME/go/bin
-pathman add $HOME/go/bin
-echo "go get golang.org/x/tools/cmd/goimports"
-$golang_install_path/bin/go get golang.org/x/tools/cmd/goimports > /dev/null 2>/dev/null
+ # simpler for single-binary commands
+ #mv ./example*/bin/example "$HOME/.local/bin"
+
+ # best for packages and toolchains
+ rm -rf "$new_go_home"
+ if [ -n "$(command -v rsync 2>/dev/null | grep rsync)" ]; then
+ rsync -Krl ./go*/ "$new_go_home/" 2>/dev/null
+ else
+ cp -Hr ./go*/* "$new_go_home/" 2>/dev/null
+ cp -Hr ./go*/.* "$new_go_home/" 2>/dev/null
+ fi
+
+ # Install x go
+ $new_go_home/bin/go get golang.org/x/tools/cmd/goimports > /dev/null 2>/dev/null
+ $new_go_home/bin/go get golang.org/x/tools/cmd/gorename > /dev/null 2>/dev/null
+ $new_go_home/bin/go get golang.org/x/tools/cmd/gotype > /dev/null 2>/dev/null
+ $new_go_home/bin/go get golang.org/x/tools/cmd/stringer > /dev/null 2>/dev/null
+popd 2>&1 >/dev/null
+
+###################
+# Update PATH #
+###################
+
+# TODO get better output from pathman / output the path to add as return to webi bootstrap
+pathman add "$new_go_home"
+pathman add "$HOME/go/bin/"
+echo "Installed 'go' (and go tools)"
+echo ""