Cannot install any Go tools on VS Code?

blov · · 3811 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I can&#39;t find working fix to the error log shown below, it occurs after writting any code in with Go format on VS Code, wich triggers a suggestion to install the needed tools for the extension to be fully functional (note that GOPATH is set, and Golang is installed in PATH):</p> <pre><code>Installing 12 tools gocode gopkgs go-outline go-symbols guru gorename gomodifytags impl godef golint gotests dlv Installing gocode FAILED Installing gopkgs FAILED Installing go-outline FAILED Installing go-symbols FAILED Installing guru FAILED Installing gorename FAILED Installing gomodifytags FAILED Installing impl FAILED Installing godef FAILED Installing golint FAILED Installing gotests FAILED Installing dlv FAILED 12 tools failed to install. gocode: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/nsf/gocode github.com/nsf/gocode (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/nsf/gocode: exec: &#34;git&#34;: executable file not found in %PATH% github.com/nsf/gocode (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/nsf/gocode: exec: &#34;git&#34;: executable file not found in %PATH% gopkgs: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/tpng/gopkgs github.com/tpng/gopkgs (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/tpng/gopkgs: exec: &#34;git&#34;: executable file not found in %PATH% github.com/tpng/gopkgs (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/tpng/gopkgs: exec: &#34;git&#34;: executable file not found in %PATH% go-outline: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/ramya-rao-a/go-outline github.com/ramya-rao-a/go-outline (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/ramya-rao-a/go-outline: exec: &#34;git&#34;: executable file not found in %PATH% github.com/ramya-rao-a/go-outline (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/ramya-rao-a/go-outline: exec: &#34;git&#34;: executable file not found in %PATH% go-symbols: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/acroca/go-symbols github.com/acroca/go-symbols (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/acroca/go-symbols: exec: &#34;git&#34;: executable file not found in %PATH% github.com/acroca/go-symbols (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/acroca/go-symbols: exec: &#34;git&#34;: executable file not found in %PATH% guru: Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/guru Fetching https://golang.org/x/tools/cmd/guru?go-get=1 Parsing meta tags from https://golang.org/x/tools/cmd/guru?go-get=1 (status code 200) get &#34;golang.org/x/tools/cmd/guru&#34;: found meta tag main.metaImport{Prefix:&#34;golang.org/x/tools&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://go.googlesource.com/tools&#34;} at https://golang.org/x/tools/cmd/guru?go-get=1 get &#34;golang.org/x/tools/cmd/guru&#34;: verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) go: missing Git command. See https://golang.org/s/gogetcmd package golang.org/x/tools/cmd/guru: exec: &#34;git&#34;: executable file not found in %PATH% Fetching https://golang.org/x/tools/cmd/guru?go-get=1 Parsing meta tags from https://golang.org/x/tools/cmd/guru?go-get=1 (status code 200) get &#34;golang.org/x/tools/cmd/guru&#34;: found meta tag main.metaImport{Prefix:&#34;golang.org/x/tools&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://go.googlesource.com/tools&#34;} at https://golang.org/x/tools/cmd/guru?go-get=1 get &#34;golang.org/x/tools/cmd/guru&#34;: verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) go: missing Git command. See https://golang.org/s/gogetcmd package golang.org/x/tools/cmd/guru: exec: &#34;git&#34;: executable file not found in %PATH% gorename: Error: Command failed: C:\Go\bin\go.exe get -u -v golang.org/x/tools/cmd/gorename Fetching https://golang.org/x/tools/cmd/gorename?go-get=1 Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status code 200) get &#34;golang.org/x/tools/cmd/gorename&#34;: found meta tag main.metaImport{Prefix:&#34;golang.org/x/tools&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://go.googlesource.com/tools&#34;} at https://golang.org/x/tools/cmd/gorename?go-get=1 get &#34;golang.org/x/tools/cmd/gorename&#34;: verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) go: missing Git command. See https://golang.org/s/gogetcmd package golang.org/x/tools/cmd/gorename: exec: &#34;git&#34;: executable file not found in %PATH% Fetching https://golang.org/x/tools/cmd/gorename?go-get=1 Parsing meta tags from https://golang.org/x/tools/cmd/gorename?go-get=1 (status code 200) get &#34;golang.org/x/tools/cmd/gorename&#34;: found meta tag main.metaImport{Prefix:&#34;golang.org/x/tools&#34;, VCS:&#34;git&#34;, RepoRoot:&#34;https://go.googlesource.com/tools&#34;} at https://golang.org/x/tools/cmd/gorename?go-get=1 get &#34;golang.org/x/tools/cmd/gorename&#34;: verifying non-authoritative meta tag Fetching https://golang.org/x/tools?go-get=1 Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200) golang.org/x/tools (download) go: missing Git command. See https://golang.org/s/gogetcmd package golang.org/x/tools/cmd/gorename: exec: &#34;git&#34;: executable file not found in %PATH% gomodifytags: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/fatih/gomodifytags github.com/fatih/gomodifytags (download) </code></pre> <p>go: missing Git command. See <a href="https://golang.org/s/gogetcmd" rel="nofollow">https://golang.org/s/gogetcmd</a> package github.com/fatih/gomodifytags: exec: &#34;git&#34;: executable file not found in %PATH% github.com/fatih/gomodifytags (download) go: missing Git command. See <a href="https://golang.org/s/gogetcmd" rel="nofollow">https://golang.org/s/gogetcmd</a> package github.com/fatih/gomodifytags: exec: &#34;git&#34;: executable file not found in %PATH%</p> <pre><code>impl: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/josharian/impl github.com/josharian/impl (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/josharian/impl: exec: &#34;git&#34;: executable file not found in %PATH% github.com/josharian/impl (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/josharian/impl: exec: &#34;git&#34;: executable file not found in %PATH% godef: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/rogpeppe/godef </code></pre> <p>github.com/rogpeppe/godef (download) go: missing Git command. See <a href="https://golang.org/s/gogetcmd" rel="nofollow">https://golang.org/s/gogetcmd</a> package github.com/rogpeppe/godef: exec: &#34;git&#34;: executable file not found in %PATH% github.com/rogpeppe/godef (download) go: missing Git command. See <a href="https://golang.org/s/gogetcmd" rel="nofollow">https://golang.org/s/gogetcmd</a> package github.com/rogpeppe/godef: exec: &#34;git&#34;: executable file not found in %PATH%</p> <pre><code>golint: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/golang/lint/golint github.com/golang/lint (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/golang/lint/golint: exec: &#34;git&#34;: executable file not found in %PATH% github.com/golang/lint (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/golang/lint/golint: exec: &#34;git&#34;: executable file not found in %PATH% gotests: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/cweill/gotests/... github.com/cweill/gotests (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/cweill/gotests/...: exec: &#34;git&#34;: executable file not found in %PATH% github.com/cweill/gotests (download) go: missing Git command. See https://golang.org/s/gogetcmd package github.com/cweill/gotests/...: exec: &#34;git&#34;: executable file not found in %PATH% dlv: Error: Command failed: C:\Go\bin\go.exe get -u -v github.com/derekparker/delve/cmd/dlv </code></pre> <p>github.com/derekparker/delve (download) go: missing Git command. See <a href="https://golang.org/s/gogetcmd" rel="nofollow">https://golang.org/s/gogetcmd</a> package github.com/derekparker/delve/cmd/dlv: exec: &#34;git&#34;: executable file not found in %PATH% github.com/derekparker/delve (download) go: missing Git command. See <a href="https://golang.org/s/gogetcmd" rel="nofollow">https://golang.org/s/gogetcmd</a> package github.com/derekparker/delve/cmd/dlv: exec: &#34;git&#34;: executable file not found in %PATH%</p> <hr/>**评论:**<br/><br/>fmpwizard: <pre><p>You need to install git and have it in your path </p></pre>Pra3t0r5: <pre><p>Done, packages installed, but F5 still throws:</p> <pre><code>Failed to continue: &#34;Cannot find Delve debugger. Install from https://github.com/derekparker/delve &amp; ensure it is in your &#34;GOPATH/bin&#34; or &#34;PATH&#34;. </code></pre> <p>In fact, dlv was not installed in any of those destinations. And i&#39;m a total noob with github, how i install delve?</p></pre>Pancakepalpatine: <pre><p>Try &#34;go get <a href="https://github.com/derekparker/delve" rel="nofollow">https://github.com/derekparker/delve</a>&#34;</p> <p>edit: in your terminal, of course.</p></pre>bluepost14: <pre><p>Nope. There&#39;s no possible way</p></pre>Pancakepalpatine: <pre><p>Oh no. Oh gosh. If the terminal isn&#39;t working, I don&#39;t know what to tell you...</p> <p>If that&#39;s true, that means you&#39;ve been hit with the BlueNexus virus - you&#39;re going to need to find/buy another expendable computer, connect both computers with a USB drive, and try to coax the virus into your other PC. You&#39;ll know when the virus has switched PCs, because you won&#39;t be able to open the terminal on the other computer, but you will be able to open it on your own.</p> <p>After the virus has jumped ship, update Adobe Flash Player. It&#39;s the only thing that can keep the virus from returning to your original computer. If you&#39;re up to date, uninstall and reinstall it.</p> <p>Once the virus is contained on the other PC, you&#39;re going to need to find a safe way to dispose of it. BlueNexus is known for jumping airgapped computers - meaning if you throw it away, it could spread to other electronics in the dump and eventually spread into cities. We don&#39;t want that.</p> <p>I recommend filling your tub with hydrochloric acid, and dipping the PC in there for ten minutes at a time. Don&#39;t dip for longer than that, or the virus might realize what&#39;s going on, and enter hibernation mode. </p> <p>After you&#39;ve dipped it ten or more times, you&#39;re going to want to ask Siri for the nearest metal foundry or swamp. After 3AM but before 4AM (that&#39;s when the NSA satellites install updates and aren&#39;t watching) you&#39;ll want to dress in all black, drive to the foundry/swamp, and throw the computer in. Before throwing it in, it&#39;s advisable to make it as discreet as possible, so that no one finds it and inadvertently releases any of the virus in the future. I recommend covering it in manure.</p> <p>Drive back home, and make sure to text your wife &#34;hey, got some cream cheese from WalMart&#34; or something like that so you have an alibi in case this ever comes back to bite you.</p> <p>Hope this helps!</p></pre>zanven42: <pre><p>Do you even have a go path defined? For repos you &#39;go get&#39; to go too?</p></pre>luckyleprechaun98: <pre><p>Come on. It says exactly what is wrong about 20 times in there. </p></pre>dlsniper: <pre><p>That just shows how bad programmers are at handling errors :D</p></pre>ChristophBerger: <pre><p>When you type <code>git</code> in a command prompt window, do you get an error message? </p> <p>If git works fine in a command prompt window, try the same in a terminal pane in VSCode. If <code>git</code> fails only there, it seems VSCode somehow reads a different <code>%PATH%</code> variable where the path to <code>git</code> is missing.</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

3811 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传