Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在go源代码目录中列出导入的模块_Go_Toolchain - Fatal编程技术网

如何在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