LoginSignup
5
5

More than 5 years have passed since last update.

Go のあるパッケージが参照している外部パッケージを一覧化する

Posted at

Dependency の管理を特に行っておらず、 GOPATH 配下のパッケージを直接参照する Go のプレーンな手法に頼っているプロジェクトにおいて、参照している外部パッケージを一覧化します。

$ cd $GOPATH/src/path/to/target/
$ go list -f '{{join .Deps "\n"}}' |  xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' | grep -v `go list`

GO15VENDOREXPERIMENTGodep などで Vendoring しているプロジェクトの場合はそこからリストアップします。

参考

5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5