MCPcopy
hub / github.com/cortesi/devd / getBody

Function getBody

fileserver/fileserver_test.go:825–835  ·  view source on GitHub ↗
(t *testing.T, testName string, req http.Request)

Source from the content-addressed store, hash-verified

823}
824
825func getBody(t *testing.T, testName string, req http.Request) (*http.Response, []byte) {
826 r, err := http.DefaultClient.Do(&req)
827 if err != nil {
828 t.Fatalf("%s: for URL %q, send error: %v", testName, req.URL.String(), err)
829 }
830 b, err := ioutil.ReadAll(r.Body)
831 if err != nil {
832 t.Fatalf("%s: for URL %q, reading body: %v", testName, req.URL.String(), err)
833 }
834 return r, b
835}
836
837type panicOnSeek struct{ io.ReadSeeker }

Callers 1

TestServeFileFunction · 0.85

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected