diff options
Diffstat (limited to 'pkg/refs/refcounter.go')
-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. |