From 23aaf45871c516aaf83f35e1be7698561741cc2f Mon Sep 17 00:00:00 2001 From: Albert Tedja Date: Fri, 15 Sep 2017 19:38:01 -0700 Subject: [PATCH] Using bytes.Buffer rather than + for string concat --- logger.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/logger.go b/logger.go index c679c787..2bfab5c1 100644 --- a/logger.go +++ b/logger.go @@ -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",