Skip to content

Support repositories with several go.mod modules #80

Open

Description

@adityankale190895

Part of #76.

A repository with a root go.mod plus nested modules (for example tools/go.mod or examples/go.mod) falls back unless it sets "go": { "scope": "root-module" }. Even then, changes inside the nested modules always fall back:

Changes in a Go module outside the declared root-module scope require full validation

Proposal

  • Analyse every module in the repository, not just the root: run go list from each go.mod directory and merge the results.
  • A nested module that requires another in-repo module by module path, with no local replace, uses the published version, so there's no edge. Only a local replace creates an edge (see the replace issue).
  • Keep go.scope: root-module as an opt-out for repositories that want the current behaviour.

Must fall back (blocker)

  • Any module whose go list fails, or whose files can't be assigned to exactly one module.

Done when

  • A fixture with a root module and tools/go.mod shows that a change in tools/ runs only tools tests, without any go.scope setting.

Shares most of its code with the go.work issue. Whoever picks up either one, coordinate on the tracking issue.

Activity

  1. added
    enhancement
    help wanted
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    adapterenhancementhelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions