From 2947981b6137df0e8e9ed89c36c40cbafef86e7b Mon Sep 17 00:00:00 2001 From: mopemoepe Date: Fri, 18 Jul 2014 08:56:59 +0900 Subject: [PATCH] Fix Corrupted plainRender --- render/render.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/render/render.go b/render/render.go index 809ef89..2915ddc 100644 --- a/render/render.go +++ b/render/render.go @@ -64,6 +64,11 @@ func (_ plainRender) Render(w http.ResponseWriter, code int, data ...interface{} writeHeader(w, code, "text/plain") format := data[0].(string) args := data[1].([]interface{}) - _, err := w.Write([]byte(fmt.Sprintf(format, args))) + var err error + if len(args) > 0 { + _, err = w.Write([]byte(fmt.Sprintf(format, args...))) + } else { + _, err = w.Write([]byte(format)) + } return err }