欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

VSCode安裝go相關(guān)插件失敗的簡(jiǎn)單解決方案

 更新時(shí)間:2023年07月10日 09:58:56   作者:mlwise  
這篇文章主要給大家介紹了關(guān)于VSCode安裝go相關(guān)插件失敗的簡(jiǎn)單解決方案,VSCode是我們開發(fā)go程序的常用工具,最近安裝的時(shí)候遇到了些問題,需要的朋友可以參考下

 1. GO環(huán)境信息

C:\Users\home>go version
go version go1.18.2 windows/amd64
 
C:\Users\home>

安裝go插件之后,VSCode開始寫代碼會(huì)提示安裝其他插件,錯(cuò)誤信息如下:

Installing 8 tools at C:\Go\repository\bin in module mode.
  gotests
  gomodifytags
  impl
  goplay
  dlv
  staticcheck
  gopls
  go-outline
 
Installing github.com/cweill/gotests/gotests@latest FAILED
Installing github.com/fatih/gomodifytags@latest FAILED
Installing github.com/josharian/impl@latest FAILED
Installing github.com/go-delve/delve/cmd/dlv@latest FAILED
Installing github.com/haya14busa/goplay/cmd/goplay@latest FAILED
Installing github.com/go-delve/delve/cmd/dlv@latest FAILED
Installing honnef.co/go/tools/cmd/staticcheck@latest FAILED
Installing honnef.co/go/tools/cmd/staticcheck@latest FAILED
Installing golang.org/x/tools/gopls@latest FAILED
Installing github.com/ramya-rao-a/go-outline@latest FAILED

無法下載插件只能通過設(shè)置GOPROXY代理解決

go env -w GOPROXY=https://mirrors.aliyun.com/goproxy/

修改之后

Installing 8 tools at C:\Go\repository\bin in module mode.
  gotests
  gomodifytags
  impl
  goplay
  dlv
  staticcheck
  gopls
  go-outline
 
Installing github.com/cweill/gotests/gotests@latest (C:\Go\repository\bin\gotests.exe) SUCCEEDED
Installing github.com/fatih/gomodifytags@latest (C:\Go\repository\bin\gomodifytags.exe) SUCCEEDED
Installing github.com/josharian/impl@latest (C:\Go\repository\bin\impl.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@latest (C:\Go\repository\bin\dlv.exe) SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay@latest (C:\Go\repository\bin\goplay.exe) SUCCEEDED
Installing github.com/go-delve/delve/cmd/dlv@latest (C:\Go\repository\bin\dlv.exe) SUCCEEDED
Installing honnef.co/go/tools/cmd/staticcheck@latest (C:\Go\repository\bin\staticcheck.exe) SUCCEEDED
Installing honnef.co/go/tools/cmd/staticcheck@latest (C:\Go\repository\bin\staticcheck.exe) SUCCEEDED
Installing golang.org/x/tools/gopls@latest (C:\Go\repository\bin\gopls.exe) SUCCEEDED
 
1 tools failed to install.
 
impl: failed to install impl(github.com/josharian/impl@latest): Error: Command failed: C:\Go\bin\go.exe install -v github.com/josharian/impl@latest
go: github.com/josharian/impl@latest: module github.com/josharian/impl: reading https://mirrors.aliyun.com/goproxy/github.com/josharian/impl/@v/list: 404 Not Found
 
Installing golang.org/x/tools/gopls@latest (C:\Go\repository\bin\gopls.exe) SUCCEEDED
Installing github.com/ramya-rao-a/go-outline@latest FAILED
{
 "killed": false,
 "code": 1,
 "signal": null,
 "cmd": "C:\\Go\\bin\\go.exe install -v github.com/ramya-rao-a/go-outline@latest",
 "stdout": "",
 "stderr": "go: github.com/ramya-rao-a/go-outline@latest: no matching versions for query \"latest\"\n"
}
 
1 tools failed to install.
 
go-outline: failed to install go-outline(github.com/ramya-rao-a/go-outline@latest): Error: Command failed: C:\Go\bin\go.exe install -v github.com/ramya-rao-a/go-outline@latest
go: github.com/ramya-rao-a/go-outline@latest: no matching versions for query "latest"

還是有一個(gè)報(bào)錯(cuò),未能成功安裝全部插件,然后切換到%GOPATH%\pkg\mod\github.com目錄,例如

C:\Go\repository\pkg\mod\github.com

執(zhí)行如下命令

git clone https://github.com/josharian/impl

 然后切換到GOPATH目錄,執(zhí)行如下命令

PS C:\go\repository> go install github.com/josharian/impl@latest
PS C:\go\repository> go install github.com/ramya-rao-a/go-outline@latest
go: downloading github.com/ramya-rao-a/go-outline v0.0.0-20210608161538-9736a4bde949
go: downloading golang.org/x/tools v0.1.1
PS C:\go\repository>

 上述命令結(jié)束之后,重啟VSCode,這下寫Go代碼就沒有問題了。

總結(jié)

到此這篇關(guān)于VSCode安裝go相關(guān)插件失敗的簡(jiǎn)單解決方案的文章就介紹到這了,更多相關(guān)VSCode安裝go插件失敗內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 一文帶你了解Go語言中鎖特性和實(shí)現(xiàn)

    一文帶你了解Go語言中鎖特性和實(shí)現(xiàn)

    Go語言中的sync包主要提供的對(duì)并發(fā)操作的支持,標(biāo)志性的工具有cond(條件變量)?once?(原子性)?還有?鎖,本文會(huì)主要向大家介紹Go語言中鎖的特性和實(shí)現(xiàn),感興趣的可以了解下
    2024-03-03
  • go語言程序cpu過高問題排查的方法詳解

    go語言程序cpu過高問題排查的方法詳解

    使用golang進(jìn)行復(fù)雜的組合運(yùn)算,導(dǎo)致CPU占用率非常高,下面這篇文章主要給大家介紹了關(guān)于go語言程序cpu過高問題排查的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-04-04
  • 一文搞懂如何實(shí)現(xiàn)Go 超時(shí)控制

    一文搞懂如何實(shí)現(xiàn)Go 超時(shí)控制

    這篇文章主要介紹了一文搞懂如何實(shí)現(xiàn)Go 超時(shí)控制,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2021-03-03
  • 淺談Go語言的高效編碼細(xì)節(jié)

    淺談Go語言的高效編碼細(xì)節(jié)

    這篇文章主要介紹了淺談Go語言的高效編碼細(xì)節(jié),我們都知道golang是天生的高并發(fā),高效的編譯型語言,可我們也都可知道,工具再好,用法不對(duì),全都白費(fèi),我們來舉2個(gè)常用路徑來感受一下
    2023-01-01
  • Go語言數(shù)據(jù)類型詳細(xì)介紹

    Go語言數(shù)據(jù)類型詳細(xì)介紹

    這篇文章主要介紹了Go語言數(shù)據(jù)類型詳細(xì)介紹,Go語言數(shù)據(jù)類型包含基礎(chǔ)類型和復(fù)合類型兩大類,下文關(guān)于這兩類型的相關(guān)介紹,需要的小伙伴可以參考一下
    2022-03-03
  • golang 整合antlr語法校驗(yàn)解析

    golang 整合antlr語法校驗(yàn)解析

    Antlr是一個(gè)語法分析器,本身是用java實(shí)現(xiàn)的,然是Runtime的庫也支持Golang、Java、Python等,本文給大家講解使用golang整合antlr進(jìn)行語法解析,感興趣的朋友一起看看吧
    2023-02-02
  • golang 對(duì)私有函數(shù)進(jìn)行單元測(cè)試的實(shí)例

    golang 對(duì)私有函數(shù)進(jìn)行單元測(cè)試的實(shí)例

    這篇文章主要介紹了golang 對(duì)私有函數(shù)進(jìn)行單元測(cè)試的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧
    2021-05-05
  • Go語言實(shí)現(xiàn)控制臺(tái)輸入&生成隨機(jī)數(shù)詳解

    Go語言實(shí)現(xiàn)控制臺(tái)輸入&生成隨機(jī)數(shù)詳解

    這篇文章主要介紹了Go語言如何實(shí)現(xiàn)控制臺(tái)輸入&生成隨機(jī)數(shù),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2022-05-05
  • golang中的三個(gè)點(diǎn) ''...''的用法示例詳解

    golang中的三個(gè)點(diǎn) ''...''的用法示例詳解

    這篇文章主要介紹了golang中的三個(gè)點(diǎn) '...' 的用法示例詳解,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2020-11-11
  • go get 和 go install 對(duì)比介紹

    go get 和 go install 對(duì)比介紹

    go install和go get都是Go語言的工具命令,但它們之間有一些區(qū)別。go get:用于從遠(yuǎn)程代碼存儲(chǔ)庫(如 GitHub)中下載或更新Go代碼包。go install:用于編譯并安裝 Go 代碼包,本文go get和go install對(duì)比介紹的非常詳細(xì),需要的朋友可以參考一下
    2023-04-04

最新評(píng)論