mirror of
https://github.com/gin-gonic/gin.git
synced 2025-08-24 16:01:46 +08:00
Replace bytes.Buffer with strings.Builder where appropriate (#3347)
To build strings more efficiently, use strings.Builder instead.
This commit is contained in:
@ -5,12 +5,12 @@
|
||||
package gin
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@ -401,7 +401,7 @@ func TestGithubAPI(t *testing.T) {
|
||||
}
|
||||
|
||||
func exampleFromPath(path string) (string, Params) {
|
||||
output := new(bytes.Buffer)
|
||||
output := new(strings.Builder)
|
||||
params := make(Params, 0, 6)
|
||||
start := -1
|
||||
for i, c := range path {
|
||||
|
Reference in New Issue
Block a user