From 2f6189eeff9c3cffa796b6078e21ff738f3603f1 Mon Sep 17 00:00:00 2001 From: gan-of-culture <53971163+gan-of-culture@users.noreply.github.com> Date: Sun, 6 Jul 2025 23:58:13 +0200 Subject: [PATCH] x/tools/gopls/internal/analysis/modernize/stringscutprefix add space Added a space so the fix does match the pattern shown in the description / comments. Without this change the fix of the code would be edited to this: after, ok :=strings.CutPrefix... After the change it should looks like this: after, ok := strings.CutPrefix... Will add the space anyway, but it would be nice to have the space out of the box. --- gopls/internal/analysis/modernize/stringscutprefix.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gopls/internal/analysis/modernize/stringscutprefix.go b/gopls/internal/analysis/modernize/stringscutprefix.go index f04c0b2ebe8..c46d59060d5 100644 --- a/gopls/internal/analysis/modernize/stringscutprefix.go +++ b/gopls/internal/analysis/modernize/stringscutprefix.go @@ -115,7 +115,7 @@ func stringscutprefix(pass *analysis.Pass) { { Pos: call.Fun.Pos(), End: call.Fun.Pos(), - NewText: fmt.Appendf(nil, "%s, %s :=", after, okVarName), + NewText: fmt.Appendf(nil, "%s, %s := ", after, okVarName), }, { Pos: call.Fun.Pos(),