mirror of
https://github.com/gin-gonic/gin.git
synced 2025-08-23 07:20:50 +08:00
Gin1.5 bytes.Buffer to strings.Builder (#1939)
* Replace bytes.Buffer to strings.Builder * Merge the latest changes * Update errors.go
This commit is contained in:
@ -5,9 +5,9 @@
|
||||
package gin
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/gin-gonic/gin/internal/json"
|
||||
)
|
||||
@ -158,7 +158,7 @@ func (a errorMsgs) String() string {
|
||||
if len(a) == 0 {
|
||||
return ""
|
||||
}
|
||||
var buffer bytes.Buffer
|
||||
var buffer strings.Builder
|
||||
for i, msg := range a {
|
||||
fmt.Fprintf(&buffer, "Error #%02d: %s\n", i+1, msg.Err)
|
||||
if msg.Meta != nil {
|
||||
|
Reference in New Issue
Block a user