Skip to content

Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase.

fix: thread persisted --include-dir into readGoModules

Alex Matthews371ce1648cb6
diff --git a/src/graph/build.ts b/src/graph/build.ts
index 1957fa0b..3d5fbd5a 100644
--- a/src/graph/build.ts
+++ b/src/graph/build.ts
@@ -115,7 +115,12 @@ export interface GraphBuildResult {
/** Every Go module in the repo: each `go.mod`'s declared `module` path and the repo
* directory it lives in (posix, `.` for the root). Found anywhere in the tree, so a
* monorepo whose module is in a subdir (e.g. `backend/go.mod`) resolves too. Lets edge
- * resolution map Go import paths to in-repo files. */
+ * resolution map Go import paths to in-repo files.
+ *
+ * `repoFiles` is buildGraph's single enumeration, which already carries root's
+ * persisted `--include-dir` override — so a `go.mod` living under an included
+ * dir (e.g. `build/go.mod`) is found here exactly when its `.go` files are
+ * indexed, and its intra-module imports resolve. */
function readGoModules(root: string, repoFiles: string[]): GoModule[] {
const mods: GoModule[] = [];
for (const f of repoFiles) {