~axwalk/gomaasapi/maas-testserver-zones

« back to all changes in this revision

Viewing changes to testing.go

  • Committer: Tarmac
  • Author(s): Raphael Badin
  • Date: 2013-07-30 08:29:05 UTC
  • mfrom: (42.1.1 read-close)
  • Revision ID: tarmac-20130730082905-neqonnq9tk03ll8f
[r=jtv][bug=][author=rvb] The http package documentation specifies that an http response body must always be closed after use.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
import (
7
7
        "fmt"
8
 
        "io/ioutil"
9
8
        "net/http"
10
9
        "net/http/httptest"
11
10
)
26
25
                if requested {
27
26
                        http.Error(writer, "Already requested", http.StatusServiceUnavailable)
28
27
                }
29
 
                res, err := ioutil.ReadAll(request.Body)
 
28
                res, err := readAndClose(request.Body)
30
29
                if err != nil {
31
30
                        panic(err)
32
31
                }