一. 现象
?二.?问题定位
文件?build\blueprint\pathtools\glob_test.go
func TestGlobEscapes(t *testing.T) {
?? ?os.Chdir("testdata/escapes")
?? ?defer os.Chdir("../..")
?? ?for _, testCase := range globEscapeTestCases {
?? ??? ?t.Run(testCase.pattern, func(t *testing.T) {
?? ??? ??? ?testGlob(t, OsFs, testCase, FollowSymlinks)
?? ??? ?})
?? ?}
}
再根据glob_test.go?查找到谁调用的此方法
build\blueprint\Blueprints
bootstrap_go_package {
? ? name: "blueprint-pathtools",
? ? pkgPath: "github.com/google/blueprint/pathtools",
? ? deps: [
? ? ? ? "blueprint-deptools",
? ? ],
? ? srcs: [
? ? ? ? "pathtools/lists.go",
? ? ? ? "pathtools/fs.go",
? ? ? ? "pathtools/glob.go",
? ? ],
? ? testSrcs: [
? ? ? ? "pathtools/fs_test.go",
? ? ? ? "pathtools/glob_test.go",
? ? ],
}
屏蔽"pathtools/glob.go"。
修改后如下:
bootstrap_go_package {
name: "blueprint-pathtools",
pkgPath: "github.com/google/blueprint/pathtools",
deps: [
"blueprint-deptools",
],
srcs: [
"pathtools/lists.go",
"pathtools/fs.go",
"pathtools/glob.go",
],
testSrcs: [
"pathtools/fs_test.go",
],
}
三. 重新编译,执行make -j8即可
|