[Go] Bypass object decode in case of empty body
Fixes
@@ -339,6 +339,9 @@ func (c *APIClient) prepareRequest(
}
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
+ if len(b) == 0 {
+ return nil
+ }
if s, ok := v.(*string); ok {
*s = string(b)
return nil
