Quick Start¶
This guide walks through the core features in under two minutes.
1. Install¶
Or install from the VS Code Marketplace Extensions panel.
2. Open a Go file¶
Create a file with a struct that has padding issues:
3. See the warnings¶
The struct name is underlined with a yellow warning. Hover to see:
The code lens above the struct shows:
4. Apply the quick fix¶
Click the lightbulb or press Ctrl+. with the cursor on Event. Choose Reorder struct fields to optimize memory layout.
Fields are reordered by alignment (largest first), minimizing padding while preserving tags, comments, and indentation.
5. Check the side panel¶
Click the code lens annotation or run Go Struct: Analyze Struct Layout from the Command Palette (Ctrl+Shift+P). The side panel shows:
- Current Layout — actual field offsets and padding
- Size-Optimal — minimal total size layout
- GC-Optimal — minimal GC scan range layout (when pointer fields are present)
Next steps¶
- Hover Information — detailed field-level data on mouseover
- Inline Annotations — code lens customization
- Warnings & Diagnostics — optimization and GC pressure hints
- Quick Fix — reorder fields in one click
- Configuration — all settings reference