##############################Deploy go enviroment######################## echo "start deploy go enviroment" cd /usr/local tar -zxvf $PACKAGE_DIR/go1.8.4.linux-amd64.tar.gz exists_path=`cat /etc/profile|grep -c "GOROOT=/usr/local/go"` if [ $exists_path -eq 0 ];then cat >> /etc/profile <<EOF export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin export PATH=$PATH:/usr/local/go/bin export GOROOT=/usr/local/go export GOPATH=/data/go EOF source /etc/profile fi rm -rf /data/go mkdir -p /data/go/src/ mkdir -p /data/go/bin mkdir -p /data/go/pkg cp -r $PACKAGE_DIR/github.com /data/go/src/ cp -r $PACKAGE_DIR/golang.org /data/go/src/ echo "success!"