fix(golang): Check error of xml Encode
@@ -376,7 +376,7 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e
} else if jsonCheck.MatchString(contentType) {
err = json.NewEncoder(bodyBuf).Encode(body)
} else if xmlCheck.MatchString(contentType) {
- xml.NewEncoder(bodyBuf).Encode(body)
+ err = xml.NewEncoder(bodyBuf).Encode(body)
}
if err != nil {
