GO環境搭建

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。
  1. yum install mercurial

    安裝 mercurial包

  2. 4

    安裝git包

    yum install git

  3. 5

    安裝gcc

    yum install gcc

  4. 6

    然後就可以下載golang的壓縮包了

    wget https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz

  5. 7

    下載完成

  6. 8

    用tar 命令來解壓壓縮包

    tar -zxvf go1.2.linux-amd64.tar.gz

  7. 9

    接著我們要添加環境變數

    vi /etc/profile

  8. 10

    在profile裡面添加如下內容

    export GOROOT=/home/forward/tools/go

    export PATH=$GOROOT/bin:$PATH

    export GOPATH=/home/forward/tools/gopkg

    GOPATH和GOROOT修改為你的路徑即可

  9. 11

    然後我們重新整理環境變數

    source /etc/profile

  10. 12

    最後我們驗證一下是否安裝成功

    go version

    如果出現下面的資訊說明安裝成功了

    1. yum install mercurial

      安裝 mercurial包

    2. 4

      安裝git包

      yum install git

    3. 5

      安裝gcc

      yum install gcc

    4. 6

      然後就可以下載golang的壓縮包了

      wget https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz

    5. 7

      下載完成

    6. 8

      用tar 命令來解壓壓縮包

      tar -zxvf go1.2.linux-amd64.tar.gz

    7. 9

      接著我們要添加環境變數

      vi /etc/profile

    8. 10

      在profile裡面添加如下內容

      export GOROOT=/home/forward/tools/go

      export PATH=$GOROOT/bin:$PATH

      export GOPATH=/home/forward/tools/gopkg

      GOPATH和GOROOT修改為你的路徑即可

    9. 11

      然後我們重新整理環境變數

      source /etc/profile

    10. 12

      最後我們驗證一下是否安裝成功

      go version

      如果出現下面的資訊說明安裝成功了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.