From e2ec08200d78de9f8ab608579400452ddb61b539 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Thu, 28 Nov 2019 10:53:06 +0100 Subject: [PATCH] log: fix staticcheck warnings (#20388) --- log/handler_glog.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/log/handler_glog.go b/log/handler_glog.go index f8b932fd1b64d..c3e64b7c2ba65 100644 --- a/log/handler_glog.go +++ b/log/handler_glog.go @@ -202,7 +202,7 @@ func (h *GlogHandler) Log(r *Record) error { } // Check callsite cache for previously calculated log levels h.lock.RLock() - lvl, ok := h.siteCache[r.Call.PC()] + lvl, ok := h.siteCache[r.Call.Frame().PC] h.lock.RUnlock() // If we didn't cache the callsite yet, calculate it @@ -210,13 +210,13 @@ func (h *GlogHandler) Log(r *Record) error { h.lock.Lock() for _, rule := range h.patterns { if rule.pattern.MatchString(fmt.Sprintf("%+s", r.Call)) { - h.siteCache[r.Call.PC()], lvl, ok = rule.level, rule.level, true + h.siteCache[r.Call.Frame().PC], lvl, ok = rule.level, rule.level, true break } } // If no rule matched, remember to drop log the next time if !ok { - h.siteCache[r.Call.PC()] = 0 + h.siteCache[r.Call.Frame().PC] = 0 } h.lock.Unlock() }