Commit 6d33977b authored by Jacob Vosmaer's avatar Jacob Vosmaer

Remove early 'result' declaration

parent b35b91e1
...@@ -67,20 +67,17 @@ func git_handler(w http.ResponseWriter, r *http.Request) { ...@@ -67,20 +67,17 @@ func git_handler(w http.ResponseWriter, r *http.Request) {
func do_auth_request(r *http.Request) *http.Response { func do_auth_request(r *http.Request) *http.Response {
var err error var err error
result := &http.Response{}
url := fmt.Sprintf("http://localhost:8080%s", r.URL.RequestURI()) url := fmt.Sprintf("http://localhost:8080%s", r.URL.RequestURI())
auth_req, err := http.NewRequest(r.Method, url, nil) auth_req, err := http.NewRequest(r.Method, url, nil)
if err != nil { if err != nil {
result.StatusCode = 500 return &http.Response{StatusCode: 500}
return result
} }
for k, v := range r.Header { for k, v := range r.Header {
auth_req.Header[k] = v auth_req.Header[k] = v
} }
result, err = http_client.Do(auth_req) result, err := http_client.Do(auth_req)
if err != nil { if err != nil {
result.StatusCode = 500 return &http.Response{StatusCode: 500}
return result
} }
return result return result
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment