fix(monorel): restore cross-module binary discovery in recursive walk

The go.mod boundary check added to findMainPackages was stopping the
--recursive walk from descending into child module directories, so
modules like auth/csvauth/ were never found.

The check was redundant: groupByModule already uses findModuleRoot to
attribute each binary to its nearest go.mod ancestor, and initModuleGroup
already skips modules with uncommitted changes (an untracked go.mod
counts as an uncommitted change).  Removing the stop restores the
pre-regression behaviour.
This commit is contained in:
AJ ONeal 2026-02-28 23:54:54 -07:00
parent 1c779296e9
commit 455ceb7d69
No known key found for this signature in database

View File

@ -572,11 +572,6 @@ func findMainPackages(root string, all bool) ([]string, error) {
continue
}
child := filepath.Join(dir, name)
// Stop at directories with their own go.mod — they are independent
// module roots and should not be included in this module's walk.
if _, err := os.Stat(filepath.Join(child, "go.mod")); err == nil {
continue
}
// Skip directories that contain no git-tracked files.
if trackedDirs != nil && !trackedDirs[child] {
continue