style: use fmt.Fprintf instead of WriteString(fmt.Sprintf) (staticcheck QF1012)

Mechanical fix applied by golangci-lint --fix. Pre-existing debt that fails the staticcheck QF1012 quickfix check; no behavior change. Clears the lint gate so subsequent commits in this package set pass.
This commit is contained in:
2026-06-20 00:33:30 +01:00
parent aa7d884b0c
commit e11f140997
7 changed files with 45 additions and 45 deletions
+2 -2
View File
@@ -199,7 +199,7 @@ func TestSessionPrefsASTQueryMaxResults(t *testing.T) {
var sb strings.Builder
sb.WriteString("package main\n\n")
for i := 0; i < 5; i++ {
sb.WriteString(fmt.Sprintf("func Fn%c() {}\n\n", rune('A'+i)))
fmt.Fprintf(&sb, "func Fn%c() {}\n\n", rune('A'+i))
}
testFile := filepath.Join(tmpDir, "many.go")
if err := os.WriteFile(testFile, []byte(sb.String()), 0600); err != nil {
@@ -281,7 +281,7 @@ func TestSessionPrefsMaxResultsExplicitOverride(t *testing.T) {
var sb strings.Builder
sb.WriteString("package main\n\n")
for i := 0; i < 5; i++ {
sb.WriteString(fmt.Sprintf("func Fn%c() {}\n\n", rune('A'+i)))
fmt.Fprintf(&sb, "func Fn%c() {}\n\n", rune('A'+i))
}
testFile := filepath.Join(tmpDir, "many.go")
if err := os.WriteFile(testFile, []byte(sb.String()), 0600); err != nil {