Mac下go語言goclipse外掛程式安裝部署

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

Try using this URL as a Eclipse Software Site:https://raw.githubusercontent.com/GoClipse/goclipse.github.io/0.16.0/releases/

It should allow you to install 0.16.0 (or a diff version if you change the URL)

地址:http://stackoverflow.com/questions/39228197/how-install-older-goclipse-version-cannot-install-goclipse-16-1-on-eclipse-4-5

說在前面:

博導讓我學docker,看看docker源碼,還要學學go語言,想先裝環境試試。網上百度了半天想找個Eclipse外掛程式連結,就沒有一個是成功的,部落格全是複製的別人的。最上面的那個是可用的URL。看來還是需要強大的Google。希望需要在Eclipse安裝外掛程式的朋友方便使用。

Try using this URL as a Eclipse Software Site:https://raw.githubusercontent.com/GoClipse/goclipse.github.io/0.16.0/releases/It should allow you to install 0.16.0 (or a diff version if you change the URL)地址:http://stackoverflow.com/questions/39228197/how-install-older-goclipse-version-cannot-install-goclipse-16-1-on-eclipse-4-5

 

安裝步驟:

  • 步驟非常簡單
  • 第一步:
  • 選擇GoClipse即可,需要等待5分鐘左右即可安裝完畢。
  • 需要注意的是該方法需要java8,如果是java7的,需要更新到java8即可,要不然Eclipse會啟動時提醒報錯。當然還可以使用liteidex30.2.macosx-qt5,也是不錯的編譯器,輕量,安裝方便。

第二步:配置bash_profile 

  

    要注意的是:GOPATH和GOROOT的區別:GOPATH是你的工作目錄,而GOROOT是GO語言的源碼的安裝目錄。

 

第三步,就是需要配置Eclipse的環境

1、選擇喜好設定

2、先配置好goroot和工作環境

3、再配置其他的配置

主要前三個 需要按download進行下載。最後一個gofmt在goroot目錄下。

 

大功告成啦,我們來跑一個例子:

package mainimport (    "fmt")func main() {    fmt.Println("hello world")}

結果

不過最最最重要的一個,千萬要記住!eclipse的工作目錄一定要在:gopath/src/yourproject裡面,很多人如果不注意,就會遇到“Resource doesn't have a corresponding Go package" 的錯誤。如所示:

 

 

-------------原創部落格,轉載請註明出處,郵箱yusen.wu08@gmail.com-------歡迎FQ過來交流--------

 

相關文章

聯繫我們

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