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
+4 -4
View File
@@ -389,13 +389,13 @@ func (s *Searcher) FormatResultsWithOptions(results *SearchResults, opts FormatO
if opts.Verbose {
totalMatches := len(results.Results)
fileCount := len(fileResults)
sb.WriteString(fmt.Sprintf("Found %d matches in %d files", totalMatches, fileCount))
fmt.Fprintf(&sb, "Found %d matches in %d files", totalMatches, fileCount)
if results.Truncated {
sb.WriteString(fmt.Sprintf(" (truncated, total: %d)", results.Total))
fmt.Fprintf(&sb, " (truncated, total: %d)", results.Total)
}
sb.WriteString(":\n\n")
} else if results.Truncated {
sb.WriteString(fmt.Sprintf("(truncated, showing subset of %d total matches)\n\n", results.Total))
fmt.Fprintf(&sb, "(truncated, showing subset of %d total matches)\n\n", results.Total)
}
// Write results grouped by file
@@ -408,7 +408,7 @@ func (s *Searcher) FormatResultsWithOptions(results *SearchResults, opts FormatO
}
}
sb.WriteString(fmt.Sprintf("**%s**\n", relPath))
fmt.Fprintf(&sb, "**%s**\n", relPath)
if opts.Cluster {
writeClusteredResults(&sb, fileResults[file])