summaryrefslogtreecommitdiffhomepage
path: root/pkg/refs
diff options
context:
space:
mode:
authorpraveensastry <sastry.praveen@gmail.com>2019-08-06 01:15:48 +1000
committerpraveensastry <sastry.praveen@gmail.com>2019-08-06 01:15:48 +1000
commit607be0585fdc659ec3c043c989a8a6f86fcc14db (patch)
tree14c86afd532de8dc16790ecc15acff926267c6f0 /pkg/refs
parentf0507e1db1574ff165000fa5e34b651413f37aae (diff)
Add option to configure reference leak checking
Diffstat (limited to 'pkg/refs')
-rw-r--r--pkg/refs/refcounter.go14
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.