diff --git a/middleware/throttle.go b/middleware/throttle.go index 9a870d88..b1f926de 100644 --- a/middleware/throttle.go +++ b/middleware/throttle.go @@ -126,9 +126,9 @@ type token struct{} type throttler struct { tokens chan token backlogTokens chan token + retryAfterFn func(ctxDone bool) time.Duration backlogTimeout time.Duration statusCode int - retryAfterFn func(ctxDone bool) time.Duration } // setRetryAfterHeaderIfNeeded sets Retry-After HTTP header if corresponding retryAfterFn option of throttler is initialized. diff --git a/middleware/wrap_writer.go b/middleware/wrap_writer.go index 12d4faf0..f5837a1c 100644 --- a/middleware/wrap_writer.go +++ b/middleware/wrap_writer.go @@ -73,10 +73,10 @@ type WrapResponseWriter interface { // http.ResponseWriter interface. type basicWriter struct { http.ResponseWriter - wroteHeader bool + tee io.Writer code int bytes int - tee io.Writer + wroteHeader bool discard bool } diff --git a/mux_test.go b/mux_test.go index d1706ece..795ab6cd 100644 --- a/mux_test.go +++ b/mux_test.go @@ -644,11 +644,11 @@ func TestMuxHandlePatternValidation(t *testing.T) { testCases := []struct { name string pattern string + method string + path string + expectedBody string + expectedStatus int shouldPanic bool - method string // Method to be used for the test request - path string // Path to be used for the test request - expectedBody string // Expected response body - expectedStatus int // Expected HTTP status code }{ // Valid patterns { diff --git a/path_value_test.go b/path_value_test.go index 5a48698b..461b5c20 100644 --- a/path_value_test.go +++ b/path_value_test.go @@ -15,9 +15,9 @@ func TestPathValue(t *testing.T) { name string pattern string method string - pathKeys []string requestPath string expectedBody string + pathKeys []string }{ { name: "Basic path value",