(t *testing.T, obj map[string]interface{}, ts *httptest.Server)
| 43 | } |
| 44 | |
| 45 | func post(t *testing.T, obj map[string]interface{}, ts *httptest.Server) (resp *http.Response, body []byte) { |
| 46 | blob, err := json.Marshal(obj) |
| 47 | if err != nil { |
| 48 | t.Fatal(err) |
| 49 | } |
| 50 | |
| 51 | resp, err = http.Post(ts.URL, "application/json", bytes.NewReader(blob)) |
| 52 | if err != nil { |
| 53 | t.Fatal(err) |
| 54 | } |
| 55 | body, err = io.ReadAll(resp.Body) |
| 56 | if err != nil { |
| 57 | t.Fatal(err) |
| 58 | } |
| 59 | return |
| 60 | } |
| 61 | |
| 62 | func get(t *testing.T, ts *httptest.Server) (resp *http.Response, body []byte) { |
| 63 | resp, err := http.Get(ts.URL) |
no outgoing calls
no test coverage detected
searching dependent graphs…