gograph_literals
Find every composite-literal initialization site for a named Go struct, returning file paths and line numbers. Use before adding a required field to assess migration impact.
Instructions
Find every composite-literal initialization site for a named Go struct — all locations where Foo{...} syntax is used to construct the struct. The MCP server checks freshness before this call and refreshes in the current requested analysis mode; precise and precise_fallback graphs retry CHA/SSA after source changes. Read-only; no side effects. WHEN TO USE: Before adding a required field to a struct — every site returned will fail to compile if the new field has no default; run this first to scope the migration blast radius. NOT TO USE: For finding string or integer magic values (use gograph_envs or grep for those); for factory functions that return the struct (use gograph_constructors). RETURNS: All file paths and line numbers where the named struct is composite-initialized; empty when the struct has no direct initialization sites.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| struct | Yes | The name of the struct (e.g., 'User') |