Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#810·testify

HttpSuccesss doesn't create Body -> error nil pointer dereference [Bug]

Author: KrzysztofMadejskiCreated Aug 30, 2019Updated Sep 23, 2026
Labelspkg-http

assert.HTTPSuccess() is failing in my case when my code does r *http.Request ioutil.ReadAll(r.Body).

I believe that https://github.com/stretchr/testify/blob/f35b8ab0b5a2cef36673838d662e249dd9c94686/assert/http_assertions.go#L13 should create body (even empty).

Source: stretchr/testify

View original on GitHubView discussion on GitHub