13
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Go言語: 依存するパッケージ一覧を調べたい

Posted at

Go言語で、自分が作っているプログラムが依存する外部パッケージを調べる方法です。下記のコマンドを実行すると、カレントディレクトリ以下のプログラムが依存する外部ライブラリが全て表示されます。標準ライブラリは表示されないようになっています。

$ go list -f '{{join .Deps "\n"}}' |  xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
github.com/mattn/go-sqlite3
github.com/spf13/cobra
github.com/spf13/pflag
13
12
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
13
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?