Skip to content

Commit

Permalink
chore(internal/exit): remove deprecated function (#1137)
Browse files Browse the repository at this point in the history
`exit.Exit()` was deprecated in favor of `exit.With(1)` in the past.
Delete the deprecated function and migrate its last remaining use.
  • Loading branch information
sashamelentyev committed Jul 25, 2022
1 parent d6ce3b9 commit 11a750e
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
7 changes: 0 additions & 7 deletions internal/exit/exit.go
Expand Up @@ -26,13 +26,6 @@ import "os"

var _exit = os.Exit

// Exit normally terminates the process by calling os.Exit(1). If the package
// is stubbed, it instead records a call in the testing spy.
// Deprecated: use With() instead.
func Exit() {
With(1)
}

// With terminates the process by calling os.Exit(code). If the package is
// stubbed, it instead records a call in the testing spy.
func With(code int) {
Expand Down
1 change: 0 additions & 1 deletion internal/exit/exit_test.go
Expand Up @@ -37,7 +37,6 @@ func TestStub(t *testing.T) {
want want
}{
{func() { exit.With(42) }, want{exit: true, code: 42}},
{exit.Exit, want{exit: true, code: 1}},
{func() {}, want{}},
}

Expand Down
2 changes: 1 addition & 1 deletion zapcore/entry.go
Expand Up @@ -197,7 +197,7 @@ func (a CheckWriteAction) OnWrite(ce *CheckedEntry, _ []Field) {
case WriteThenPanic:
panic(ce.Message)
case WriteThenFatal:
exit.Exit()
exit.With(1)
}
}

Expand Down

0 comments on commit 11a750e

Please sign in to comment.