From a411fe7e6e8340064f5bf8c67bfb1ae7d172905d Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 27 Jan 2016 00:49:35 +0100 Subject: [PATCH] logger/glog: fix TraceLocation.Set("") --- logger/glog/glog.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/logger/glog/glog.go b/logger/glog/glog.go index b8eaf9359..e760e507b 100644 --- a/logger/glog/glog.go +++ b/logger/glog/glog.go @@ -407,9 +407,13 @@ var errTraceSyntax = errors.New("syntax error: expect file.go:234") func (t *TraceLocation) Set(value string) error { if value == "" { // Unset. + logging.mu.Lock() t.line = 0 t.file = "" + logging.mu.Unlock() + return nil } + fields := strings.Split(value, ":") if len(fields) != 2 { return errTraceSyntax