LoginSignup
4
4

More than 5 years have passed since last update.

*_test.goが含まれているPackage一覧を取得する

Posted at

go list という便利コマンドがあるので、利用すると簡単に取得できる。

$ go list -f="{{if .TestGoFiles}}{{.ImportPath}}{{end}}" ./...

以前の自分はShellで取得していた。

$ find . -maxdepth 3 -path '*_test.go' -type f | xargs -I{} dirname {} | uniq

Gopherなら、積極的に $ go <action> を使っていきましょう。

4
4
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
4
4