diff --git a/contract/hooks.go b/contract/hooks.go index 3c8aaf7..86431ba 100644 --- a/contract/hooks.go +++ b/contract/hooks.go @@ -14,17 +14,17 @@ var HooksKey = hooksKey{} // AfterResponseHook is a callback invoked after the full HTTP response // has been written. It receives the error returned by the handler, // which may be nil if the handler succeeded. -type AfterResponseHook func(err error) +type AfterResponseHook = func(err error) // BeforeWriteHeaderHook is a callback invoked just before the // response status code is written. It receives the response writer // and the status code that is about to be sent. -type BeforeWriteHeaderHook func(w http.ResponseWriter, status int) +type BeforeWriteHeaderHook = func(w http.ResponseWriter, status int) // BeforeWriteHook is a callback invoked just before response body // bytes are written. It receives the response writer and the byte // slice that is about to be sent. -type BeforeWriteHook func(w http.ResponseWriter, content []byte) +type BeforeWriteHook = func(w http.ResponseWriter, content []byte) // Hooks defines the contract for registering and retrieving // lifecycle callbacks during HTTP request processing. Middleware