func s3unmarshalXMLError(v interface{}, stream io.Reader) error {
	var errBuf bytes.Buffer
	body := io.TeeReader(stream, &errBuf)

	err := xml.NewDecoder(body).Decode(v)
	if err != nil && err != io.EOF {
		return awserr.NewUnmarshalError(err,
			"failed to unmarshal error message", errBuf.Bytes())
	}

	return err
}
// s3unmarshalXMLError is s3 specific xml error unmarshaler
// for 200 OK errors and response payloads.
// This function differs from the xmlUtil.UnmarshalXMLError
// func. It does not ignore the EOF error and passes it up.
// Related to bug fix for `s3 200 OK response with empty payload`
s3unmarshalXMLError is s3 specific xml error unmarshaler
for 200 OK errors and response payloads.
This function differs from the xmlUtil.UnmarshalXMLError
func. It does not ignore the EOF error and passes it up.
Related to bug fix for `s3 200 OK response with empty payload`
// s3unmarshalXMLError is s3 specific xml error unmarshaler // for 200 OK errors and response payloads . // This function differs from the xmlUtil . UnmarshalXMLError // func . It does not ignore the EOF error and passes it up . // Related to bug fix for ` s3 200 OK response with empty payload `
func s3unmarshalXMLError(v interface{}, stream io.Reader) error {
	var errBuf bytes.Buffer
	body := io.TeeReader(stream, &errBuf)
	err := xml.NewDecoder(body).Decode(v)
	if err != nil && err != io.EOF {
		return awserr.NewUnmarshalError(err,
			"failed to unmarshal error message", errBuf.Bytes())
	}
	return err
}
func s3unmarshalXMLError ( v interface { } , stream io . Reader ) error { var errBuf bytes . Buffer body := io . TeeReader ( stream , & errBuf ) err := xml . NewDecoder ( body ) . Decode ( v ) if err != nil && err != io . EOF { return awserr . NewUnmarshalError ( err , " " , errBuf . Bytes ( ) ) } return err }
s3unmarshalXMLError is s3 specific xml error unmarshaler
for 200 OK errors and response payloads.
s3unmarshalXMLError is s3 specific xml error unmarshaler for 200 OK errors and response payloads .