mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-23 18:22:23 +08:00
Using bytes.Buffer rather than + for string concat
This commit is contained in:
parent
5afc5b1973
commit
23aaf45871
@ -5,6 +5,7 @@
|
||||
package gin
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
@ -100,7 +101,11 @@ func LoggerWithWriter(out io.Writer, notlogged ...string) HandlerFunc {
|
||||
comment := c.Errors.ByType(ErrorTypePrivate).String()
|
||||
|
||||
if raw != "" {
|
||||
path = path + "?" + raw
|
||||
var buffer bytes.Buffer
|
||||
buffer.WriteString(path)
|
||||
buffer.WriteString("?")
|
||||
buffer.WriteString(raw)
|
||||
path = buffer.String()
|
||||
}
|
||||
|
||||
fmt.Fprintf(out, "[GIN] %v |%s %3d %s| %13v | %15s |%s %-7s %s %s\n%s",
|
||||
|
Loading…
x
Reference in New Issue
Block a user