forked from loafle/openapi-generator-original
fix(golang): Check error of xml Encode (#3027)
This commit is contained in:
parent
87adba9c4b
commit
a2e84c348c
@ -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 {
|
||||
|
@ -387,7 +387,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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user