فهرست منبع

chore: add missing copyright and update if/else (#1497)

田欧 7 سال پیش
والد
کامیت
b7bb9baa64
2فایلهای تغییر یافته به همراه6 افزوده شده و 2 حذف شده
  1. 4 0
      render/reader.go
  2. 2 2
      render/text.go

+ 4 - 0
render/reader.go

@@ -1,3 +1,7 @@
+// Copyright 2018 Gin Core Team.  All rights reserved.
+// Use of this source code is governed by a MIT style
+// license that can be found in the LICENSE file.
+
 package render
 
 import (

+ 2 - 2
render/text.go

@@ -30,7 +30,7 @@ func WriteString(w http.ResponseWriter, format string, data []interface{}) {
 	writeContentType(w, plainContentType)
 	if len(data) > 0 {
 		fmt.Fprintf(w, format, data...)
-	} else {
-		io.WriteString(w, format)
+		return
 	}
+	io.WriteString(w, format)
 }