Skip to content

Commit

Permalink
Merge #47761
Browse files Browse the repository at this point in the history
47761: util/log: fix lying comment r=knz a=andreimatei

SetExitFunc() claimed that a nil function was a way to reset it. It
wasn't; it'd lead to a crash.

Release note: None

Co-authored-by: Andrei Matei <andrei@cockroachlabs.com>
  • Loading branch information
craig[bot] and andreimatei committed Apr 22, 2020
2 parents 3df13ef + 570daff commit 332b5a9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/util/log/exit_override.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
}

Expand Down

0 comments on commit 332b5a9

Please sign in to comment.