Browse Source

fix gopath

Jrohy 5 years ago
parent
commit
e293ecd70c
1 changed files with 4 additions and 4 deletions
  1. 4 4
      go-install.sh

+ 4 - 4
go-install.sh

@@ -48,9 +48,6 @@ ipIsConnect(){
 }
 
 setupEnv(){
-    if [[ -z `echo $PATH|grep /usr/lib/go/bin` ]];then
-        echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
-    fi
     if [[ -z `echo $GOPATH` ]];then
         while :
         do
@@ -66,9 +63,12 @@ setupEnv(){
             break
         done
         echo "GOPATH值为: `colorEcho $BLUE $GOPATH`"
-        echo 'export GOPATH=$GOPATH' >> /etc/profile
+        echo "export GOPATH=$GOPATH" >> /etc/profile
         echo 'export PATH=$PATH:$GOPATH/bin' >> /etc/profile
     fi
+    if [[ -z `echo $PATH|grep /usr/lib/go/bin` ]];then
+        echo 'export PATH=$PATH:/usr/local/go/bin' >> /etc/profile
+    fi
     source /etc/profile
 }