From decbd081673e1bbc531ce1f3606418f2bdee5ef7 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Mon, 8 Feb 2016 11:00:00 +0100
Subject: [PATCH] Fix golang install script.

---
 setup_go.sh | 24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/setup_go.sh b/setup_go.sh
index 0d27fc3..fc2f344 100755
--- a/setup_go.sh
+++ b/setup_go.sh
@@ -4,8 +4,6 @@ set -e
 set -x
 
 url=$1
-user=plom
-users_home=`su $user -s /bin/sh -c 'echo ~'`
 
 ensure_line() {
     add_string="$1"
@@ -22,18 +20,18 @@ if [ "$url" = "" ]; then
     echo 'Need URL of current go package'
     exit 1
 fi
-rm -rf /usr/local/go
-apt-get -y install wget
+sudo rm -rf /usr/local/go
+sudo apt-get -y install wget
 wget -O $filename $url
-tar -C /usr/local -xzf $filename
+sudo tar -C /usr/local -xzf $filename
 rm $filename
-ensure_line 'export PATH=$PATH:/usr/local/go/bin' $users_home/.shinit_add
-ensure_line 'export GOPATH=~/gopath' $users_home/.shinit_add
-apt-get -y install vim-pathogen
-rm -rf $users_home/.vim/bundle/vim-go
-su $user -s 'git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go'
-ensure_line 'source ~/.vimrc_vimgo' $users_home/.vimrc_add
-cat << EOF > $users_home/.vimrc_vimgo
+ensure_line 'export PATH=$PATH:/usr/local/go/bin' ~/.shinit_add
+ensure_line 'export GOPATH=~/gopath' ~/.shinit_add
+sudo apt-get -y install vim-pathogen
+rm -rf ~/.vim/bundle/vim-go
+git clone https://github.com/fatih/vim-go.git ~/.vim/bundle/vim-go
+ensure_line 'source ~/.vimrc_vimgo' ~/.vimrc_add
+cat << EOF > ~/.vimrc_vimgo
 " vim-go: Make vim-go run.
 call pathogen#infect()
 let g:go_disable_autoinstall = 0
@@ -44,5 +42,3 @@ let g:go_highlight_structs = 1
 let g:go_highlight_operators = 1
 let g:go_highlight_build_constraints = 1
 EOF
-chown $user $users_home/.vimrc_vimgo
-chgrp $user $users_home/.vimrc_vimgo
-- 
2.30.2