func newDecodeResponseError(resp *http.Response, bodyData []byte, err error) *DecodeResponseError {
	if bodyData == nil {
		bodyData = readBodyForError(resp.Body)
	}
	resp1 := *resp
	resp1.Body = ioutil.NopCloser(bytes.NewReader(bodyData))

	return &DecodeResponseError{
		Response:    &resp1,
		DecodeError: errgo.Mask(err, errgo.Any),
	}
}
// newDecodeResponseError returns a new DecodeResponseError that
// uses the given error for its message. The Response field
// holds a copy of req. If bodyData is non-nil, it
// will be used as the data in the Response.Body field;
// otherwise body data will be read from req.Body.
newDecodeResponseError returns a new DecodeResponseError that
uses the given error for its message. The Response field
holds a copy of req. If bodyData is non-nil, it
will be used as the data in the Response.Body field;
otherwise body data will be read from req.Body.
// newDecodeResponseError returns a new DecodeResponseError that // uses the given error for its message . The Response field // holds a copy of req . If bodyData is non - nil it // will be used as the data in the Response . Body field ; // otherwise body data will be read from req . Body .
func newDecodeResponseError(resp *http.Response, bodyData []byte, err error) *DecodeResponseError {
	if bodyData == nil {
		bodyData = readBodyForError(resp.Body)
	}
	resp1 := *resp
	resp1.Body = ioutil.NopCloser(bytes.NewReader(bodyData))
	return &DecodeResponseError{
		Response:    &resp1,
		DecodeError: errgo.Mask(err, errgo.Any),
	}
}
func newDecodeResponseError ( resp * http . Response , bodyData [ ] byte , err error ) * DecodeResponseError { if bodyData == nil { bodyData = readBodyForError ( resp . Body ) } resp1 := * resp resp1 . Body = ioutil . NopCloser ( bytes . NewReader ( bodyData ) ) return & DecodeResponseError { Response : & resp1 , DecodeError : errgo . Mask ( err , errgo . Any ) , } }
newDecodeResponseError returns a new DecodeResponseError that
uses the given error for its message.
newDecodeResponseError returns a new DecodeResponseError that uses the given error for its message .