gograph_deps
List import dependencies of a Go package. Get direct or full transitive imports to audit package layering or map dependency chains before removal.
Instructions
List the import dependencies of a named package. With transitive=false (default), returns only direct imports. With transitive=true, returns the full BFS closure of all transitive imports. Requires .gograph/graph.json — run gograph build . first. Read-only; no side effects. WHEN TO USE: When auditing package layering, understanding what a package pulls in, or mapping import chains before removing a dependency. NOT TO USE: For reverse lookup of who imports the package (use gograph_dependents); for symbol-level call tracing (use gograph_callers/gograph_impact). RETURNS: JSON with direct[] and transitive[] import path arrays; {"found":false} when the package is not in the graph.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package | Yes | The target package path or name to inspect (e.g., 'internal/search', 'internal/cli') | |
| transitive | No | If true, return the full transitive import closure via Breadth-First Search (BFS) |