diff --git a/internal/logger/reduce.go b/internal/logger/reduce.go index b35ebf3..75997ef 100644 --- a/internal/logger/reduce.go +++ b/internal/logger/reduce.go @@ -30,11 +30,12 @@ func reducePkgElements(elems []string) string { // Function used to reduce a Function name (from logging) func ReduceFunctionName(function string) string { + functionLock.Lock() + defer functionLock.Unlock() + if ret, ok := functionCache[function]; ok { return ret } - functionLock.Lock() - defer functionLock.Unlock() dir := filepath.Dir(function) base := filepath.Base(function)