From 6f3d96ccff56290fd506dff68af21a56a22d0873 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 9 May 2020 17:41:00 +0800 Subject: [PATCH] chore: improve render string performance (#2365) --- render/text.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/render/text.go b/render/text.go index 4e52d4c5..30f5f532 100644 --- a/render/text.go +++ b/render/text.go @@ -6,7 +6,6 @@ package render import ( "fmt" - "io" "net/http" ) @@ -35,6 +34,6 @@ func WriteString(w http.ResponseWriter, format string, data []interface{}) (err _, err = fmt.Fprintf(w, format, data...) return } - _, err = io.WriteString(w, format) + _, err = w.Write([]byte(format)) return }