linting changes

Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
This commit is contained in:
unclejack 2015-06-16 12:51:27 +03:00
parent e89ce58e24
commit bfdf63d37c
11 changed files with 48 additions and 27 deletions

View file

@ -7,7 +7,7 @@ import (
"github.com/docker/docker/pkg/jsonmessage"
)
// Request a given URL and return an io.Reader
// Download requests a given URL and returns an io.Reader
func Download(url string) (resp *http.Response, err error) {
if resp, err = http.Get(url); err != nil {
return nil, err
@ -18,6 +18,7 @@ func Download(url string) (resp *http.Response, err error) {
return resp, nil
}
// NewHTTPRequestError returns a JSON response error
func NewHTTPRequestError(msg string, res *http.Response) error {
return &jsonmessage.JSONError{
Message: msg,

View file

@ -26,6 +26,8 @@ func ResumableRequestReader(c *http.Client, r *http.Request, maxfail uint32, tot
return &resumableRequestReader{client: c, request: r, maxFailures: maxfail, totalSize: totalsize}
}
// ResumableRequestReaderWithInitialResponse makes it possible to resume
// reading the body of an already initiated request.
func ResumableRequestReaderWithInitialResponse(c *http.Client, r *http.Request, maxfail uint32, totalsize int64, initialResponse *http.Response) io.ReadCloser {
return &resumableRequestReader{client: c, request: r, maxFailures: maxfail, totalSize: totalsize, currentResponse: initialResponse}
}