From 093fd342041c3190e313d545488de450cf2cd77b Mon Sep 17 00:00:00 2001 From: Sasha Melentyev Date: Sat, 23 Jul 2022 13:22:12 +0300 Subject: [PATCH] chore: remove deprecated internal func --- internal/exit/exit.go | 7 ------- internal/exit/exit_test.go | 1 - zapcore/entry.go | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/internal/exit/exit.go b/internal/exit/exit.go index 187fe5bfe..f673f9947 100644 --- a/internal/exit/exit.go +++ b/internal/exit/exit.go @@ -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) { diff --git a/internal/exit/exit_test.go b/internal/exit/exit_test.go index 0f86a8844..229958472 100644 --- a/internal/exit/exit_test.go +++ b/internal/exit/exit_test.go @@ -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{}}, } diff --git a/zapcore/entry.go b/zapcore/entry.go index 216a86d93..76eea2822 100644 --- a/zapcore/entry.go +++ b/zapcore/entry.go @@ -197,7 +197,7 @@ func (a CheckWriteAction) OnWrite(ce *CheckedEntry, _ []Field) { case WriteThenPanic: panic(ce.Message) case WriteThenFatal: - exit.Exit() + exit.With(1) } }