I have some code that makes get requests to a dynamic website, which I want to test. Obviously the tests need to be run by anyone at any time, so rather than actually use the REST API, is it possible to put a json string into an *http.Response for testing purposes.
example code:
func get (c *http.Response, err error) (string, error) {
//code
}
test file:
func TestGet(t *testing.T) {
//code to have put json string for test *http.Response
get(???, nil)
}