KDOC 420: testdataはコンパイル対象外になる
この文書のステータス
- 作成
- <署名>
- レビュー
- <署名>
概要
Go言語で、コンパイル対象にならないディレクトリがある。Goファイルが含まれていても、無視される。
https://github.com/golang/go/blob/988a20c8c5e2c9eb49f8749e5ee94ce3c964fe59/src/cmd/go/internal/help/helpdoc.go#L124-L125
Directory and file names that begin with "." or "_" are ignored by the go tool, as are directories named "testdata".
https://github.com/golang/go/blob/988a20c8c5e2c9eb49f8749e5ee94ce3c964fe59/src/cmd/go/internal/modindex/read.go#L404-L409
// goroot and gopath inTestdata := func(sub string) bool { return strings.Contains(sub, "/testdata/") || strings.HasSuffix(sub, "/testdata") || str.HasPathPrefix(sub, "testdata") } var pkga string if !inTestdata(rp.dir) {
関連
なし。