diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-04-02 10:39:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-02 10:39:47 +0200 |
commit | 0c2618bc7d495322c6413b0ff62549712747cf9e (patch) | |
tree | 03ddc67b73733d0582367e9038c454353fa55955 /plumbing/transport/http/common.go | |
parent | 160e6d5b654fbbaf0d9264f226c56a03f0e27d30 (diff) | |
parent | 6e07548d9078505ca2945f09d11729b14abcc907 (diff) | |
download | go-git-0c2618bc7d495322c6413b0ff62549712747cf9e.tar.gz |
Merge pull request #794 from jfontan/fix/checkclose
Use CheckClose with named returns and fix tests
Diffstat (limited to 'plumbing/transport/http/common.go')
-rw-r--r-- | plumbing/transport/http/common.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/plumbing/transport/http/common.go b/plumbing/transport/http/common.go index 24e63a4..2c337b7 100644 --- a/plumbing/transport/http/common.go +++ b/plumbing/transport/http/common.go @@ -31,7 +31,7 @@ func applyHeadersToRequest(req *http.Request, content *bytes.Buffer, host string const infoRefsPath = "/info/refs" -func advertisedReferences(s *session, serviceName string) (*packp.AdvRefs, error) { +func advertisedReferences(s *session, serviceName string) (ref *packp.AdvRefs, err error) { url := fmt.Sprintf( "%s%s?service=%s", s.endpoint.String(), infoRefsPath, serviceName, @@ -52,12 +52,12 @@ func advertisedReferences(s *session, serviceName string) (*packp.AdvRefs, error s.ModifyEndpointIfRedirect(res) defer ioutil.CheckClose(res.Body, &err) - if err := NewErr(res); err != nil { + if err = NewErr(res); err != nil { return nil, err } ar := packp.NewAdvRefs() - if err := ar.Decode(res.Body); err != nil { + if err = ar.Decode(res.Body); err != nil { if err == packp.ErrEmptyAdvRefs { err = transport.ErrEmptyRemoteRepository } |