Add Result types to Go SDK and properly populate body/map fields (#358)

This commit is contained in:
Jeff Mitchell authored and GitHub committed 2020-09-15 01:08:21 -04:00
1 parent d8dc1ed0b2
commit a00ee7a948
61 files changed
+1888 -1099

No files matched your search

+3
View File
@@ -71,6 +71,9 @@ func (r *Response) Decode(inStruct interface{}) (*Error, error) {
}
}
if r.resp.StatusCode >= 400 {
errStruct := inStruct.(*Error)
errStruct.responseBody = r.Body
errStruct.responseMap = r.Map
return apiErr, nil
}