diff --git a/pkg/util/log/exit_override.go b/pkg/util/log/exit_override.go index df9666800f01..3c711b675864 100644 --- a/pkg/util/log/exit_override.go +++ b/pkg/util/log/exit_override.go @@ -21,8 +21,11 @@ import ( // if true, suppresses the stack trace, which is useful for test // callers wishing to keep the logs reasonably clean. // -// Call with a nil function to undo. +// Use ResetExitFunc() to reset. func SetExitFunc(hideStack bool, f func(int)) { + if f == nil { + panic("nil exit func invalid") + } setExitErrFunc(hideStack, func(x int, err error) { f(x) }) }