mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +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:
parent
069e80b9e0
commit
8cd3cb043b
@ -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))
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user