-1

Is there an tool or easiest way to list all imported packages on go source code directory? for example:

$ go list_imports a_directory/
github.com/bla/bla
github.com/foo/bar
LOCAL/module/path
Kokizzu
  • 24,974
  • 37
  • 137
  • 233
  • 3
    Check out this answer: [Listing packages and their dependencies (imports)](http://stackoverflow.com/a/28166550/1705598) – icza Feb 25 '15 at 09:19
  • 1
    possible duplicate of [How to list installed go packages](http://stackoverflow.com/questions/28166249/how-to-list-installed-go-packages) – Jason Coco Feb 25 '15 at 23:56

1 Answers1

0

Ah found the way..

go list -f '{{join .Deps "\n"}}' |  xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}} ' | sort | uniq
Kokizzu
  • 24,974
  • 37
  • 137
  • 233