set -e
set -x
+url=$1
+
ensure_line() {
add_string="$1"
file="$2"
filename=temp_golang_binary
-if [ "$1" = "" ]; then
+if [ "$url" = "" ]; then
echo 'Need URL of current go package'
exit 1
fi
sudo rm -rf /usr/local/go
sudo apt-get -y install wget
-wget -O $filename $1
+wget -O $filename $url
sudo tar -C /usr/local -xzf $filename
rm $filename
ensure_line 'export PATH=$PATH:/usr/local/go/bin' ~/.shinit_add