From eae2147735b8af0633c75b0b3ddabf8f74a43b80 Mon Sep 17 00:00:00 2001 From: mishudark Date: Tue, 29 Mar 2016 23:28:53 -0600 Subject: [PATCH] chore(output.go): delete not used variable (status int) in check status functions --- context/output.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/context/output.go b/context/output.go index 17404702..0de0a60c 100644 --- a/context/output.go +++ b/context/output.go @@ -269,55 +269,55 @@ func (output *BeegoOutput) SetStatus(status int) { // IsCachable returns boolean of this request is cached. // HTTP 304 means cached. -func (output *BeegoOutput) IsCachable(status int) bool { +func (output *BeegoOutput) IsCachable() bool { return output.Status >= 200 && output.Status < 300 || output.Status == 304 } // IsEmpty returns boolean of this request is empty. // HTTP 201,204 and 304 means empty. -func (output *BeegoOutput) IsEmpty(status int) bool { +func (output *BeegoOutput) IsEmpty() bool { return output.Status == 201 || output.Status == 204 || output.Status == 304 } // IsOk returns boolean of this request runs well. // HTTP 200 means ok. -func (output *BeegoOutput) IsOk(status int) bool { +func (output *BeegoOutput) IsOk() bool { return output.Status == 200 } // IsSuccessful returns boolean of this request runs successfully. // HTTP 2xx means ok. -func (output *BeegoOutput) IsSuccessful(status int) bool { +func (output *BeegoOutput) IsSuccessful() bool { return output.Status >= 200 && output.Status < 300 } // IsRedirect returns boolean of this request is redirection header. // HTTP 301,302,307 means redirection. -func (output *BeegoOutput) IsRedirect(status int) bool { +func (output *BeegoOutput) IsRedirect() bool { return output.Status == 301 || output.Status == 302 || output.Status == 303 || output.Status == 307 } // IsForbidden returns boolean of this request is forbidden. // HTTP 403 means forbidden. -func (output *BeegoOutput) IsForbidden(status int) bool { +func (output *BeegoOutput) IsForbidden() bool { return output.Status == 403 } // IsNotFound returns boolean of this request is not found. // HTTP 404 means forbidden. -func (output *BeegoOutput) IsNotFound(status int) bool { +func (output *BeegoOutput) IsNotFound() bool { return output.Status == 404 } // IsClientError returns boolean of this request client sends error data. // HTTP 4xx means forbidden. -func (output *BeegoOutput) IsClientError(status int) bool { +func (output *BeegoOutput) IsClientError() bool { return output.Status >= 400 && output.Status < 500 } // IsServerError returns boolean of this server handler errors. // HTTP 5xx means server internal error. -func (output *BeegoOutput) IsServerError(status int) bool { +func (output *BeegoOutput) IsServerError() bool { return output.Status >= 500 && output.Status < 600 }