An architecture-aware Go code extractor and visualiser that maps dependencies, detects hexagonal patterns, and renders interactive D3.js graphs.
I built GoScope because I kept joining Go codebases and spending the first week just figuring out how things connected. The idea is simple: point at any symbol by file, line, and column, and it performs a depth-limited BFS traversal to collect all dependencies up to a configurable depth.
Phase 1 is the core CLI — it outputs dependency trees in Markdown, JSON, or HTML. Phase 2 adds the visualiser: an interactive D3.js force-directed graph where you can zoom, drag, and click nodes to view their code and documentation inline. It makes the invisible architecture visible.
Phase 3 is where it gets clever. It automatically detects interface-to-implementation relationships, recognises DI frameworks (Wire, Fx, or manual dependency injection), and identifies hexagonal architecture patterns. Nodes get colour-coded: green for interfaces, purple for implementations, orange for constructors. You can literally see whether a codebase follows clean architecture just by looking at the graph.
The whole thing was built with TDD — over 190 tests at 75-78% coverage. The architecture follows its own advice: clean separation into locator, collector, and formatter layers.