From dde1b64e3299662f4c8b7b7ed732b7ad77443a84 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 22 Jul 2023 14:14:50 +0200 Subject: [PATCH] Removed SetStatus --- Context.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Context.go b/Context.go index b2715e0..29d151f 100644 --- a/Context.go +++ b/Context.go @@ -18,7 +18,6 @@ type Context interface { Reader(io.Reader) error Request() Request Response() Response - SetStatus(status int) String(string) error } @@ -59,7 +58,7 @@ func (ctx *context) Error(status int, messages ...any) error { } } - ctx.SetStatus(status) + ctx.response.WriteHeader(status) return errors.Join(combined...) } @@ -90,11 +89,6 @@ func (ctx *context) Response() Response { return &ctx.response } -// SetStatus writes the header with the given HTTP status code. -func (ctx *context) SetStatus(status int) { - ctx.response.WriteHeader(status) -} - // String responds with the given string. func (ctx *context) String(body string) error { slice := unsafe.Slice(unsafe.StringData(body), len(body))