mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 08:14:15 +00:00
internal: remove unnecessary call to Encoder.Flush
This commit is contained in:
parent
a4580254eb
commit
94d597c1f5
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user