tools icon indicating copy to clipboard operation
tools copied to clipboard

gopls: add "Replace := with var declaration" code action

Open nathannewyen opened this issue 4 weeks ago • 3 comments

Add a new refactoring code action that converts short variable declarations to explicit var declarations with separate assignment.

Example:

x := 42

becomes:

var x int
x = 42

Fixes golang/go#74838

nathannewyen avatar Dec 19 '25 02:12 nathannewyen