mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +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) {
|
func (c *Client) NewXMLRequest(method string, p string, v interface{}) (*http.Request, error) {
|
||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
buf.WriteString(xml.Header)
|
buf.WriteString(xml.Header)
|
||||||
enc := xml.NewEncoder(&buf)
|
if err := xml.NewEncoder(&buf).Encode(v); err != nil {
|
||||||
if err := enc.Encode(v); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
if err := enc.Flush(); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user