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:
parent
798bc4cd2d
commit
b3fce752d2
2 changed files with 7 additions and 20 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue