|
@@ -5,6 +5,7 @@ import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
"reflect"
|
|
|
+ "strings"
|
|
|
"sync"
|
|
|
)
|
|
|
|
|
@@ -14,6 +15,12 @@ var bufPool = sync.Pool{
|
|
|
},
|
|
|
}
|
|
|
|
|
|
+var builderPool = sync.Pool{
|
|
|
+ New: func() interface{} {
|
|
|
+ return new(strings.Builder)
|
|
|
+ },
|
|
|
+}
|
|
|
+
|
|
|
type Entry struct {
|
|
|
Name string
|
|
|
Value interface{}
|
|
@@ -22,7 +29,7 @@ type Entry struct {
|
|
|
type Entries []Entry
|
|
|
|
|
|
func (d Entries) String() string {
|
|
|
- buf := bufPool.Get().(*bytes.Buffer)
|
|
|
+ buf := builderPool.Get().(*strings.Builder)
|
|
|
last := len(d) - 1
|
|
|
|
|
|
buf.Reset()
|