pkg/metrics: protect global vars in reset func

This commit is contained in:
Yicheng Qin 2015-01-26 16:22:13 -08:00
parent f0c9a54edb
commit 8c932ff719

View File

@ -158,6 +158,8 @@ func Do(f func(expvar.KeyValue)) {
// for test only
func reset() {
mutex.Lock()
defer mutex.Unlock()
vars = make(map[string]expvar.Var)
varKeys = nil
}