From ed54cb2d7de58cca19e0f3b2f7c26906a3159411 Mon Sep 17 00:00:00 2001 From: KianYang-Lee Date: Mon, 24 Jun 2024 10:55:23 +0800 Subject: [PATCH] fix: formatting --- middleware/request/circuit_breaker.go | 3 ++- middleware/request/circuit_breaker_test.go | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/middleware/request/circuit_breaker.go b/middleware/request/circuit_breaker.go index 8008eb1..7abcc9e 100644 --- a/middleware/request/circuit_breaker.go +++ b/middleware/request/circuit_breaker.go @@ -46,13 +46,14 @@ func NewCircuitBreakerMiddleware(threshold uint, period time.Duration) func(next if err != nil { return nil, err } + return struct{}{}, nil }) if err != nil { return err } + return nil }) } - } diff --git a/middleware/request/circuit_breaker_test.go b/middleware/request/circuit_breaker_test.go index 07b5dce..9c45932 100644 --- a/middleware/request/circuit_breaker_test.go +++ b/middleware/request/circuit_breaker_test.go @@ -247,7 +247,6 @@ func TestNewCircuitBreakerMiddleware_ResetMeasureInterval(t *testing.T) { select { case err := <-results: - fmt.Println(err) if err != gobreaker.ErrOpenState && err != nil { t.Errorf("Expected error %v, but got %v", gobreaker.ErrOpenState, err) }