一个Go项目的依赖URL列表

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

List of dependency URLs of a Go project

问题

我想要获取一个Go项目中所有依赖项的tarball URL(或类似的URL)。我尝试使用'go list dependency'来实现这个目标,但是我没有找到获取依赖项源URL的可能性。我该如何获取URL呢?

英文:

I want to get a list of tarball URLs (or similar) of all dependencies in a Go project. I tried to achieve this with 'go list dependency' but I see no possibility to get the source URL of a dependency. How can I get the URL?

答案1

得分: 6

获取当前目录的导入包可以使用以下命令:
go list -f '{{join .Imports "\n"}}' .

英文:

For the current directory you get the imports by:
go list -f '{{join .Imports "\n"}}' .

huangapple
  • 本文由 发表于 2015年10月29日 20:54:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/33414849.html
匿名

发表评论

匿名网友

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

确定