diff --git a/res_tracker.go b/res_tracker.go index ceb15b9..c10268b 100644 --- a/res_tracker.go +++ b/res_tracker.go @@ -16,7 +16,7 @@ const maxStackLen = 1000 //NOTE: for simplicity not making it an atomic variable var enabled bool = false -var res2track = sync.Map{} +var res2track = &sync.Map{} type TrackedInfo struct { Time time.Time @@ -70,7 +70,7 @@ func Enable(flag bool) { } func Reset() { - res2track = sync.Map{} + res2track = &sync.Map{} } func IsOn() bool { @@ -81,7 +81,7 @@ func Count() int { return count(res2track) } -func count(m sync.Map) int { +func count(m *sync.Map) int { var i int m.Range(func(k, v interface{}) bool { i++