prevent double entry

This commit is contained in:
rootzoll 2019-12-18 20:26:47 +01:00
parent 7cce64eb1b
commit 40f8d114a5

View file

@ -48,11 +48,13 @@ if [ ${goInstalled} -eq 0 ];then
export PATH=$PATH:$GOROOT/bin
export GOPATH=/usr/local/gocode
export PATH=$PATH:$GOPATH/bin
sudo bash -c "echo 'GOROOT=/usr/local/go' >> /etc/profile"
sudo bash -c "echo 'PATH=\$PATH:\$GOROOT/bin/' >> /etc/profile"
sudo bash -c "echo 'GOPATH=/usr/local/gocode' >> /etc/profile"
sudo bash -c "echo 'PATH=\$PATH:\$GOPATH/bin/' >> /etc/profile"
if [ $(cat /etc/profile | grep -c "GOROOT=") -eq 0 ]; then
sudo bash -c "echo 'GOROOT=/usr/local/go' >> /etc/profile"
sudo bash -c "echo 'PATH=\$PATH:\$GOROOT/bin/' >> /etc/profile"
sudo bash -c "echo 'GOPATH=/usr/local/gocode' >> /etc/profile"
sudo bash -c "echo 'PATH=\$PATH:\$GOPATH/bin/' >> /etc/profile"
fi
# set GOPATH https://github.com/golang/go/wiki/SettingGOPATH
go env -w GOPATH=/usr/local/gocode