Skip to content

Commit 2f6189e

Browse files
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.
1 parent b5e741b commit 2f6189e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gopls/internal/analysis/modernize/stringscutprefix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func stringscutprefix(pass *analysis.Pass) {
115115
{
116116
Pos: call.Fun.Pos(),
117117
End: call.Fun.Pos(),
118-
NewText: fmt.Appendf(nil, "%s, %s :=", after, okVarName),
118+
NewText: fmt.Appendf(nil, "%s, %s := ", after, okVarName),
119119
},
120120
{
121121
Pos: call.Fun.Pos(),

0 commit comments

Comments
 (0)