1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-16 18:01:37 +00:00

refactor: replace Sprintf with string concatenation

There is no need to have go parse the whole format string then introspect the
arguments when we an simply use string concatenation.
This commit is contained in:
Julien Voisin 2025-08-06 04:47:26 +02:00 committed by GitHub
parent 798bc4cd2d
commit b3fce752d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 20 deletions

View file

@ -6,7 +6,6 @@ package response // import "miniflux.app/v2/internal/http/response"
import (
"compress/flate"
"compress/gzip"
"fmt"
"io"
"log/slog"
"net/http"
@ -48,7 +47,7 @@ func (b *Builder) WithBody(body any) *Builder {
// WithAttachment forces the document to be downloaded by the web browser.
func (b *Builder) WithAttachment(filename string) *Builder {
b.headers["Content-Disposition"] = fmt.Sprintf("attachment; filename=%s", filename)
b.headers["Content-Disposition"] = "attachment; filename=" + filename
return b
}