diff options
| author | Shulhan <ms@kilabit.info> | 2019-01-29 04:49:10 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2019-01-29 04:49:10 +0700 |
| commit | 452bacc95b77fe86a7bf01baeeb1543c6e3483a8 (patch) | |
| tree | f010367cafe6fe586d1a406a2c6e4365c7c2f42d | |
| parent | 32f128a78635c8eb68d28df9804fb157901e8cbd (diff) | |
| download | pakakeh.go-452bacc95b77fe86a7bf01baeeb1543c6e3483a8.tar.xz | |
lib/http: simplified if-else condition
| -rw-r--r-- | lib/http/endpoint.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/http/endpoint.go b/lib/http/endpoint.go index c241c391..2e9da168 100644 --- a/lib/http/endpoint.go +++ b/lib/http/endpoint.go @@ -125,10 +125,8 @@ func (ep *Endpoint) error(res http.ResponseWriter, e error) { Code: http.StatusInternalServerError, Message: e.Error(), } - } else { - if se.Code == 0 { - se.Code = http.StatusInternalServerError - } + } else if se.Code == 0 { + se.Code = http.StatusInternalServerError } res.WriteHeader(se.Code) |
