Commit a839127f authored by Jacob Vosmaer's avatar Jacob Vosmaer

Move variable declarations

parent 3b9e6e34
...@@ -80,8 +80,7 @@ func git_handler(w http.ResponseWriter, r *http.Request) { ...@@ -80,8 +80,7 @@ func git_handler(w http.ResponseWriter, r *http.Request) {
http.Error(w, "Not found", 404) http.Error(w, "Not found", 404)
} }
func do_auth_request(r *http.Request) (*http.Response, error) { func do_auth_request(r *http.Request) (result *http.Response, err error) {
var err error
url := fmt.Sprintf("%s%s", *auth_backend, r.URL.RequestURI()) url := fmt.Sprintf("%s%s", *auth_backend, 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 {
...@@ -90,7 +89,7 @@ func do_auth_request(r *http.Request) (*http.Response, error) { ...@@ -90,7 +89,7 @@ func do_auth_request(r *http.Request) (*http.Response, error) {
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 {
return nil, err return nil, err
} }
......
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