doutan4831 2016-06-10 19:06
浏览 106
已采纳

无法使用go get安装兽医软件包

I'm running following command:

$ go get -u golang.org/x/tools/cmd/vet

package golang.org/x/tools/cmd/vet: cannot find package "golang.org/x/tools/cmd/vet" in any of: C:\Development\Software\go\src\golang.org\x\tools\cmd\vet (from $GOROOT)
C:\Development\Software\go\downloaded_packages\src\golang.org\x\tools\cmd\vet (from $GOPATH)

I can't really understand how cannot find package makes sense with get. It is supposed to get the package from internet. Why is it looking for it locally?

  • 写回答

1条回答 默认 最新

  • douluchuo0801 2016-06-10 22:41
    关注

    @JimB summed it up in the comments - you don't need to install go vet separately.

    But just for completeness, the direct answer to OP question is that the code for the go vet command no longer lives at golang.org/x/tools/cmd/vet (see https://golang.org/doc/go1.2#go_tools_godoc - and since that the code has moved to GitHub).

    So when you run: go get -u golang.org/x/tools/cmd/vet it appears that it is git cloning the golang.org/x/tools/cmd package and then trying to compile golang.org/x/tools/cmd/vet which is resulting in an error ("cannot find package...") because the "vet" part doesn't exist - it moved out a while ago. (go get first downloads/clones the code and then attempts to compile the package on your local system.)

    And all of that is to say, you probably already have go vet - try typing "go vet -h" and if it works (you should see something like: "usage: vet ..."), you're set.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用
  • ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
  • ¥15 怎么配置广告联盟瀑布流
  • ¥15 Rstudio 保存代码闪退
  • ¥20 win系统的PYQT程序生成的数据如何放入云服务器阿里云window版?
  • ¥50 invest生境质量模块