如何在go源代码目录中列出导入的模块
是否有如何在go源代码目录中列出导入的模块,go,toolchain,Go,Toolchain,是否有工具或最简单的方法列出go源代码目录中所有导入的包?例如: $ go list_imports a_directory/ github.com/bla/bla github.com/foo/bar LOCAL/module/path 啊找到了 看看这个答案:可能是重复的 go list -f '{{join .Deps "\n"}}' | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}} ' | sort | un
工具
或最简单的方法列出go源代码目录中所有导入的包?例如:
$ go list_imports a_directory/
github.com/bla/bla
github.com/foo/bar
LOCAL/module/path
啊找到了
看看这个答案:可能是重复的
go list -f '{{join .Deps "\n"}}' | xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}} ' | sort | uniq