From 08f37391e1fbeb71a25cae9e4b264bc8e4bfb8ce Mon Sep 17 00:00:00 2001 From: LiuDui <1693291525@qq.com> Date: Mon, 6 Feb 2023 11:25:50 +0800 Subject: [PATCH] chore: clean up deprecated code (#2648) --- middleware/recovery/recovery.go | 6 ------ middleware/recovery/recovery_test.go | 6 ------ 2 files changed, 12 deletions(-) diff --git a/middleware/recovery/recovery.go b/middleware/recovery/recovery.go index dfa7cb7fd..66dcec182 100644 --- a/middleware/recovery/recovery.go +++ b/middleware/recovery/recovery.go @@ -29,12 +29,6 @@ func WithHandler(h HandlerFunc) Option { } } -// WithLogger with recovery logger. -// Deprecated: use global logger instead. -func WithLogger(logger log.Logger) Option { - return func(o *options) {} -} - // Recovery is a server middleware that recovers from any panics. func Recovery(opts ...Option) middleware.Middleware { op := options{ diff --git a/middleware/recovery/recovery_test.go b/middleware/recovery/recovery_test.go index 985cb19b0..cf4a7fbb3 100644 --- a/middleware/recovery/recovery_test.go +++ b/middleware/recovery/recovery_test.go @@ -6,7 +6,6 @@ import ( "testing" "github.com/go-kratos/kratos/v2/errors" - "github.com/go-kratos/kratos/v2/log" ) func TestOnce(t *testing.T) { @@ -35,8 +34,3 @@ func TestNotPanic(t *testing.T) { t.Errorf("e isn't nil") } } - -// Deprecated: Remove this test with WithLogger method. -func TestWithLogger(t *testing.T) { - _ = WithLogger(log.DefaultLogger) -}