APIError.Details was empty because the ioutil.ReadAll was reading an empty http.Response.Body.
The body of the response was read earlier by the decodeResponse func before attempting to read it again in newAPIError.
Changed the signature of decodeResponse to accept a []byte as the second argument.
Example commit. Check changes made to paystack.go and error.go
APIError.Detailswas empty because theioutil.ReadAllwas reading an emptyhttp.Response.Body.The body of the response was read earlier by the
decodeResponsefunc before attempting to read it again innewAPIError.Changed the signature of
decodeResponseto accept a []byte as the second argument.Example commit. Check changes made to paystack.go and error.go