mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 18:22:23 +08:00
Replace fmt by strconv.FormatInt
This commit is contained in:
parent
86bf6f6d81
commit
29d10de4ce
@ -1,9 +1,9 @@
|
||||
package render
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type Reader struct {
|
||||
@ -16,7 +16,7 @@ type Reader struct {
|
||||
// Render (Reader) writes data with custom ContentType and headers.
|
||||
func (r Reader) Render(w http.ResponseWriter) (err error) {
|
||||
r.WriteContentType(w)
|
||||
r.Headers["Content-Length"] = fmt.Sprintf("%d", r.ContentLength)
|
||||
r.Headers["Content-Length"] = strconv.FormatInt(r.ContentLength, 10)
|
||||
r.writeHeaders(w, r.Headers)
|
||||
_, err = io.Copy(w, r.Reader)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user