CentOS下安裝go語言編譯環境

來源:互聯網
上載者:User

標籤:blank   變數   word   儲存   系統   vim   target   環境變數   lin   

1.下載Go語言的安裝包

這裡給大家一個百度的分享串連http://pan.baidu.com/s/1qY3xPaG下載到CentOS的系統之中

$ tar -xzf go1.5.2.linux-xxx.tar.gz -C /usr/local

 

2.用以上命令解壓到 /usr/local目錄之中


3.在/etc/profile中添加系統範圍的PATH環境變數。

$ vi /etc/profile

 

加入這段代碼export PATH=$PATH:/usr/local/go/bin  儲存並退出

export GOROOT=/usr/local/go

export GOPATH=/www/project    #項目代碼所在目錄

 

4.重新整理環境變數

$ source /etc/profile

 

5.產看版本

$ go version

 

如果顯示版本資訊則證明安裝配置成功

 

 

【補充】----- 如果是在自己的家目錄下安裝,其他的使用者不受影響,那麼:cd ~,進入自己的家目錄下:

tar -xzf go1.5.2.linux-xxx.tar.gz -C ./

然後 vim ./bash_profile 檔案:

export GOROOT=/home/renxing/go

export GOPATH=/home/renxing/project

 

source ./bash_profile

 

CentOS下安裝go語言編譯環境

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.