Update Go mod

As part of the annotations fix

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2020-11-20 18:23:48 +00:00
committed by Alex Ellis
parent 1a8e879f42
commit baa9a1821c
98 changed files with 2364 additions and 843 deletions

View File

@ -13,7 +13,6 @@ import (
)
var (
bufferPool *sync.Pool
// qualified package name, cached at first use
logrusPackage string
@ -31,12 +30,6 @@ const (
)
func init() {
bufferPool = &sync.Pool{
New: func() interface{} {
return new(bytes.Buffer)
},
}
// start at the bottom of the stack before the package-name cache is primed
minimumCallerDepth = 1
}
@ -243,9 +236,12 @@ func (entry Entry) log(level Level, msg string) {
entry.fireHooks()
buffer = bufferPool.Get().(*bytes.Buffer)
buffer = getBuffer()
defer func() {
entry.Buffer = nil
putBuffer(buffer)
}()
buffer.Reset()
defer bufferPool.Put(buffer)
entry.Buffer = buffer
entry.write()