diff --git a/tools/testtool/commands/list.go b/tools/testtool/commands/list.go index c74b45d..ba66a5c 100644 --- a/tools/testtool/commands/list.go +++ b/tools/testtool/commands/list.go @@ -1,8 +1,11 @@ package commands import ( + "bytes" + "io/fs" "log" "os" + "path/filepath" "sort" "strings" @@ -84,6 +87,28 @@ func listPrivateFiles(rootPackage string) []string { } } + if err := filepath.WalkDir(rootPackage, func(path string, d fs.DirEntry, err error) error { + if strings.HasSuffix(path, ".proto") { + content, err := os.ReadFile(path) + if err != nil { + return err + } + + if bytes.Contains(content, []byte("//go:build solution")) { + absPath, err := filepath.Abs(path) + if err != nil { + return err + } + + files = append(files, absPath) + } + } + + return nil + }); err != nil { + log.Fatalf("filewalk failed: %v", err) + } + sort.Strings(files) return files }