From 2513bcf584f655379bd5195dcaba83649aab9e8f Mon Sep 17 00:00:00 2001 From: Eyal Post Date: Thu, 18 May 2017 10:32:51 +0300 Subject: [PATCH] remove Redirect to avoid confusion --- context/httpResponse/response.go | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/context/httpResponse/response.go b/context/httpResponse/response.go index ca74b85c..0b013719 100644 --- a/context/httpResponse/response.go +++ b/context/httpResponse/response.go @@ -16,13 +16,6 @@ const ( NotFound StatusCode = http.StatusNotFound ) -// Redirect renders http 302 with a URL -func Redirect(localurl string) error { - return statusCodeWithRender{302, func(ctx *beecontext.Context) { - ctx.Redirect(302, localurl) - }} -} - // StatusCode sets the http response status code type StatusCode int @@ -34,19 +27,3 @@ func (s StatusCode) Error() string { func (s StatusCode) Render(ctx *beecontext.Context) { ctx.Output.SetStatus(int(s)) } - -type statusCodeWithRender struct { - statusCode int - f func(ctx *beecontext.Context) -} - -//assert that statusCodeWithRender implements Renderer interface -var _r beecontext.Renderer = (*statusCodeWithRender)(nil) - -func (s statusCodeWithRender) Error() string { - return strconv.Itoa(s.statusCode) -} - -func (s statusCodeWithRender) Render(ctx *beecontext.Context) { - s.f(ctx) -}