Usage¶
The Go Struct Analyzer provides several ways to inspect and optimize struct layouts:
| Feature | What it shows | How to access |
|---|---|---|
| Hover Information | Field size, alignment, offset, padding | Hover over struct field or name |
| Inline Annotations | Struct and field sizes in the editor | Code lens above structs (toggle in settings) |
| Warnings & Diagnostics | Optimization opportunities, GC pressure | Yellow/blue underlines + Problems panel |
| Quick Fix | One-click field reorder | Lightbulb or Ctrl+. on warning |
| Analyze Panel | Side-by-side layout comparison | Code lens click or Command Palette |
| Configuration | All settings reference | VS Code settings UI |
Each feature is designed to work without configuration — install the extension and open a Go file.
| Editor | Method |
|---|---|
| VS Code | Install the VS Code extension from Marketplace |
| Zed | Install the Zed dev extension from editors/zed/ |
| Emacs | Emacs setup guide — eglot (Emacs 29+) or lsp-mode |
| Neovim | Neovim setup guide — built-in LSP client |
| Any LSP client | gsa-lsp speaks standard LSP — configure any editor that supports inlayHint, hover, and diagnostics |