如何检查”go get “的安装状态?

huangapple go评论68阅读模式
英文:

how to check 'go get <package>' installation status?

问题

go get 命令有没有选项可以告诉我它是否真的做了什么?

例如,如果包 X 已经安装了,我想知道 go get X 没有执行任何下载/安装操作。

英文:

Is there any option for go get that can tell me whether it actually did anything?

For example, if the package X was already installed, I would like to know that go get X didn't perform any downloading/installation.

答案1

得分: 4

使用 go get -v 命令。

下面是一个示例,展示了使用和不使用 go get 命令的区别:

$ go get -v  github.com/peak6/envflag
github.com/peak6/envflag (下载) # 下载包
github.com/peak6/envflag # 构建包(我认为)

$ go get -v  github.com/peak6/envflag
$ # 无需操作
英文:

Use go get -v

Here's an example of get doing something vs not:

$ go get -v  github.com/peak6/envflag
github.com/peak6/envflag (download) # downloaded package
github.com/peak6/envflag # built package (I think)

$ go get -v  github.com/peak6/envflag
$ # nothing to do

huangapple
  • 本文由 发表于 2016年3月22日 20:20:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/36154238.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定