From a054f480adf26e90ddcb66408688486704ab7094 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Tue, 17 Sep 2024 01:19:25 +0300 Subject: simple handler --- error.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'error.go') diff --git a/error.go b/error.go index 416d578..f85174e 100644 --- a/error.go +++ b/error.go @@ -3,11 +3,11 @@ package mux import ( "context" "encoding/json" - "io" + "net/http" ) var DefaultErrorHandler func(err error) Renderer = func(err error) Renderer { - return RendererFunc(func(ctx context.Context, w io.Writer) error { + return RendererFunc(func(ctx context.Context, w http.ResponseWriter) error { return json.NewEncoder(w).Encode(errorStruct{ Message: err.Error(), }) -- cgit v1.2.3