dongshou9343 2018-12-01 17:38
浏览 71
已采纳

无法下载Go with Visual Studio所需的分析工具

I am a total newbie and only just kicked off a beginners course on Go and failing at first hurdle of installation of all the bits you need to make it work so sorry if this is a dumb question. I've installed Go, Git and Visual Studio... After first installing Visual Studio I am trying to install the 12 Analysis tools for Go but everytime i try this it fails. Generally related to a "permission denied" error. Error message below. Any ideas why?

Installing 12 tools at /Documents/go/bin gocode gopkgs
go-outline go-symbols guru gorename dlv gocode-gomod godef godef-gomod goreturns golint

Installing github.com/mdempsky/gocode FAILED Installing github.com/uudashr/gopkgs/cmd/gopkgs FAILED Installing github.com/ramya-rao-a/go-outline FAILED Installing github.com/acroca/go-symbols FAILED Installing golang.org/x/tools/cmd/guru FAILED Installing golang.org/x/tools/cmd/gorename FAILED Installing github.com/derekparker/delve/cmd/dlv FAILED Installing github.com/stamblerre/gocode FAILED Installing github.com/rogpeppe/godef FAILED Installing github.com/ianthehat/godef FAILED Installing github.com/sqs/goreturns FAILED Installing golang.org/x/lint/golint FAILED

12 tools failed to install.

gocode: Error: Command failed: /usr/local/go/bin/go get -u -v github.com/mdempsky/gocode github.com/mdempsky/gocode (download) package github.com/mdempsky/gocode: mkdir /Documents/go: permission denied github.com/mdempsky/gocode (download) package github.com/mdempsky/gocode: mkdir /Documents/go: permission denied

gopkgs: Error: Command failed: /usr/local/go/bin/go get -u -v github.com/uudashr/gopkgs/cmd/gopkgs github.com/uudashr/gopkgs (download) package github.com/uudashr/gopkgs/cmd/gopkgs: mkdir /Documents/go: permission denied github.com/uudashr/gopkgs (download) package github.com/uudashr/gopkgs/cmd/gopkgs: mkdir /Documents/go: permission denied

  • 写回答

2条回答 默认 最新

  • dongma0722 2018-12-01 18:11
    关注

    I don't use visual studio for golang so may be of limited use here if it is visual studio specific - but I've heard nothing but good things so its probably not...

    I suspect the issue is that your GOPATH is set to /Documents/go whereas you have placed your GOPATH in the Documents folder for your user. it should probably be something like %My Documents%/go or the full path to that location e.g something like /c/Users/{your user}/Documents.

    Note: I have used nix style paths - as your output does, but when setting them via windows gui you should use windows conventions, e.g C:\Users\...

    To diagnose further I would first cut the ide out of the equation and jump to the command line.

    type go env to check your paths, look particularly at GOPATH which I suspect is your problem. If it is incorrect you should change it in environment variables (google change environment variables for you windows version) - as per note above follow the conventions of the other environment variables for setting the path (windows style specification, e.g c:\Users\)

    if go env doesn't work you have a bigger issue with your go install

    If you are still having issues, please update your question, providing the output of go env as well as an outline of how you installed go (Note: I think the MSI installer takes care of it all for you)

    if go env looks fine to you, another debug step would be to attempt to install one of your tools manually from the command line and see what happens, e.g:

    go get -u -v github.com/mdempsky/gocode

    but if go env doesn't work that wont either and the issue is likely that your main go binary is not in you systems PATH environment variable but it doesn't look like that

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器