internal: remove unnecessary call to Encoder.Flush

This commit is contained in:
Simon Ser 2020-01-14 21:38:25 +01:00
parent a4580254eb
commit 94d597c1f5
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48

View File

@ -40,11 +40,7 @@ func (c *Client) NewRequest(method string, p string, body io.Reader) (*http.Requ
func (c *Client) NewXMLRequest(method string, p string, v interface{}) (*http.Request, error) {
var buf bytes.Buffer
buf.WriteString(xml.Header)
enc := xml.NewEncoder(&buf)
if err := enc.Encode(v); err != nil {
return nil, err
}
if err := enc.Flush(); err != nil {
if err := xml.NewEncoder(&buf).Encode(v); err != nil {
return nil, err
}