Skip to content

Read imports and exports for Go #39

Open

Description

@typeweaver

Context

Hidden coupling (#17) and module depth (#18) read imports and exports through one adapter per language; only TypeScript/JavaScript has one. Go's syntax makes this cheap: import blocks name package paths, a package is a directory, and exported identifiers are capitalized.

Goal

Go repositories get Coupling.imports and Module.depth like TypeScript repositories do.

Acceptance criteria

  • A Go adapter (a lightweight scanner, no new native dependency) resolves import paths under the repository's go.mod module path to the package's universe files; imports of other modules are ignored.
  • It lists a package's exported identifiers (capitalized top-level func, type, var, const) for depth.
  • A fixture repository with an imported pair, a hidden pair, and a multi-module go.work layout proves both.

References

Activity

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

    enhancementNew feature or requestpriority: lowLast in line; picked up after everything else

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions