2016-06-10 19:06
浏览 106

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

I'm running following command:

$ go get -u

package cannot find package "" in any of: C:\Development\Software\go\src\\x\tools\cmd\vet (from $GOROOT)
C:\Development\Software\go\downloaded_packages\src\\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?

图片转代码服务由CSDN问答提供 功能建议


  $ go get  -u

包找不到 软件包 “”中的任何一个: C:\ Development \ Software \ go \ src \ \ x \ tools \ cmd \ vet(来自$ GOROOT)< br> C:\ Development \ Software \ go \ downloaded_pa​​ckages \ src \ \ x \ tools \ cmd \ vet (来自$ GOPATH) < p>我真的不明白 get 为何找不到包是有意义的。 应该从互联网上获得包裹。 为什么要在本地查找?

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

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 (see - and since that the code has moved to GitHub).

    So when you run: go get -u it appears that it is git cloning the package and then trying to compile 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.

    解决 无用
    打赏 举报

相关推荐 更多相似问题