vscode中安裝ms-vscode.go插件后,可以開啟對(duì)go語(yǔ)言的支持,但是ms-vscode.go插件需要依賴一些工具。
以下為手動(dòng)安裝依賴工具的步驟:
在%GOPATH%src目錄下,建立路徑golang.orgx
進(jìn)入到%GOPATH%srcgolang.orgx,下載需要工具的源碼git clone https://github.com/golang/tools.git (tools可以是其它項(xiàng)目名)
clone完成后,會(huì)生成一個(gè)tools文件夾,這樣工具所需要的源碼已經(jīng)準(zhǔn)備好了。
進(jìn)入到%GOPATH%下,執(zhí)行:
go?install?github.com/acroca/go-symbols go?install?github.com/cweill/gotests go?install?github.com/cweill/gotests/gotests go?install?github.com/golang/lint/golint go?install?github.com/lukehoban/go-outline go?install?github.com/newhook/go-symbols go?install?github.com/nsf/gocode go?install?github.com/ramya-rao-a/go-outline go?install?github.com/rogpeppe/godef go?install?github.com/sqs/goreturns go?install?github.com/tpng/gopkgs go?install?github.com/zmb3/gogetdoc go?install?golang.org/x/tools/cmd/gorename go?install?golang.org/x/tools/cmd/guru go?install?sourcegraph.com/sqs/goreturns
如果以上執(zhí)行時(shí)有錯(cuò)誤,請(qǐng)先使用go get 后,在使用上面的命令
go?get? github.com/rogpeppe/godef go?get github.com/cweill/gotests/gotests
單獨(dú)處理golint,golint的源碼位于https://github.com/golang/lint,進(jìn)入%GOPATH%srcgolang.orgx后執(zhí)行g(shù)it clone https://github.com/golang/lint下載golint需要的源碼。
進(jìn)入到%GOPATH%下,執(zhí)行:
go?install?golang.org/x/lint/golint
這樣,vscode的golang插件所依賴的工具安裝完成了。
相關(guān)推薦:vscode教程
? 版權(quán)聲明
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載。
THE END
喜歡就支持一下吧
相關(guān)推薦