安裝go tools
安裝以上后用vim打開go代碼,使用函數跳轉時會出現:
E718: Funcref required
vim-go: could not find 'gopls'. Run :GoInstallBinaries to fix it
或者說guru等不存在的錯誤,這時按照提示在vim中執行GoInstallBinaries會出現:
Error downloading github.com/zmb3/gogetdoc
Error downloading github.com/stamblerre/gocode
...
下載不成功,原因是這里網站連不上,需要找資源下載來手動安裝。
比較重要的模塊是:guru/gopls 在使用時主要是提示這兩個模塊,因此先安裝。
guru
1、建立路徑:mkdir -p $GOPATH/github.com/Go-zh/
2、 在$GOPATH/github.com/Go-zh/ 目錄下執行git clone https://github.com/Go-zh/tools.git
3、執行安裝:
go install github.com/Go-zh/tools/cmd/guru
#以下模塊也包含了,順帶一起安裝
go install github.com/Go-zh/tools/cmd/goimports
go install github.com/Go-zh/tools/cmd/gorename
gopls
執行安裝:
go install github.com/Go-zh/tools/cmd/gopls
---------------------
作者:yefengzhichen
來源:CSDN
原文:https://blog.csdn.net/yefengzhichen/article/details/90050921
版權聲明:本文為博主原創文章,轉載請附上博文鏈接!