1
0
mirror of https://github.com/labstack/echo.git synced 2024-12-26 20:54:00 +02:00

logger: Don't copy lock value in LoggerConfig.pool, use a pointer (#825)

Fixes #710 `go vet` failures
This commit is contained in:
Peter Fern 2017-01-22 05:18:34 +11:00 committed by Vishal Rana
parent 069e80b9e0
commit 8cd3cb043b

View File

@ -54,7 +54,7 @@ type (
template *fasttemplate.Template template *fasttemplate.Template
colorer *color.Color colorer *color.Color
pool sync.Pool pool *sync.Pool
} }
) )
@ -93,7 +93,7 @@ func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc {
config.template = fasttemplate.New(config.Format, "${", "}") config.template = fasttemplate.New(config.Format, "${", "}")
config.colorer = color.New() config.colorer = color.New()
config.colorer.SetOutput(config.Output) config.colorer.SetOutput(config.Output)
config.pool = sync.Pool{ config.pool = &sync.Pool{
New: func() interface{} { New: func() interface{} {
return bytes.NewBuffer(make([]byte, 256)) return bytes.NewBuffer(make([]byte, 256))
}, },