diff options
author | praveensastry <sastry.praveen@gmail.com> | 2019-08-06 01:15:48 +1000 |
---|---|---|
committer | praveensastry <sastry.praveen@gmail.com> | 2019-08-06 01:15:48 +1000 |
commit | 607be0585fdc659ec3c043c989a8a6f86fcc14db (patch) | |
tree | 14c86afd532de8dc16790ecc15acff926267c6f0 /pkg/refs | |
parent | f0507e1db1574ff165000fa5e34b651413f37aae (diff) |
Add option to configure reference leak checking
Diffstat (limited to 'pkg/refs')
-rw-r--r-- | pkg/refs/refcounter.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/refs/refcounter.go b/pkg/refs/refcounter.go index 6ecbace9e..417f4a2d6 100644 --- a/pkg/refs/refcounter.go +++ b/pkg/refs/refcounter.go @@ -231,6 +231,20 @@ const ( LeaksLogTraces ) +// String returns LeakMode's string representation. +func (l LeakMode) String() string { + switch l { + case NoLeakChecking: + return "NoLeakChecking" + case LeaksLogWarning: + return "LeaksLogWarning" + case LeaksLogTraces: + return "LeaksLogTraces" + default: + panic(fmt.Sprintf("Invalid leakmode: %d", l)) + } +} + // leakMode stores the current mode for the reference leak checker. // // Values must be one of the LeakMode values. |