aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2019-01-29 04:49:10 +0700
committerShulhan <ms@kilabit.info>2019-01-29 04:49:10 +0700
commit452bacc95b77fe86a7bf01baeeb1543c6e3483a8 (patch)
treef010367cafe6fe586d1a406a2c6e4365c7c2f42d
parent32f128a78635c8eb68d28df9804fb157901e8cbd (diff)
downloadpakakeh.go-452bacc95b77fe86a7bf01baeeb1543c6e3483a8.tar.xz
lib/http: simplified if-else condition
-rw-r--r--lib/http/endpoint.go6
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)