這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。
Visual Studio Code 是微軟推出的一款跨平台的代碼編輯器,可以用它作為golang開發的IDE。其下載地址為:下載地址:https://code.visualstudio.com/Download,安裝完成之後還需要安裝go語言外掛程式。開啟Visual Studio Code ,按快速鍵CTRL+SHIFT+P,輸入Install Extension,然後搜尋go,選中go的開發外掛程式安裝,安裝完畢後重啟下IDE即可。 為了便於go的開發,還需要安裝一些golang相關的工具。 The extension uses the following tools, installed in the current GOPATH. If any tools are missing, you will see an "Analysis Tools Missing" warning in the bottom right corner of the editor. Clicking it will offer to install the missing tools for you. gocode: go get -u -v github.com/nsf/gocode godef: go get -u -v github.com/rogpeppe/godef golint: go get -u -v github.com/golang/lint/golint go-find-references: go get -u -v github.com/lukehoban/go-find-references go-outline: go get -u -v github.com/lukehoban/go-outline goreturns: go get -u -v sourcegraph.com/sqs/goreturns gorename: go get -u -v golang.org/x/tools/cmd/gorename gopkgs: go get -u -v github.com/tpng/gopkgs go-symbols: go get -u -v github.com/newhook/go-symbols To install them just paste and run: go get -u -v github.com/nsf/gocode go get -u -v github.com/rogpeppe/godef go get -u -v github.com/golang/lint/golint go get -u -v github.com/lukehoban/go-find-references go get -u -v github.com/lukehoban/go-outline go get -u -v sourcegraph.com/sqs/goreturns go get -u -v golang.org/x/tools/cmd/gorename go get -u -v github.com/tpng/gopkgs go get -u -v github.com/newhook/go-symbols 安裝以上工具前需要裝上go sdk,git。由於安裝的過程會下載一些google的資源,所以你的電腦環境需要能夠訪問google的相關服務,如果訪問不了,請自行搜尋翻牆的方法。
參考:https://marketplace.visualstudio.com/items?itemName=lukehoban.Go