MCPcopy Index your code
hub / github.com/kataras/iris / sendJSON

Function sendJSON

x/client/client_test.go:44–51  ·  view source on GitHub ↗
(t *testing.T, v interface{})

Source from the content-addressed store, hash-verified

42}
43
44func sendJSON(t *testing.T, v interface{}) http.HandlerFunc {
45 return func(w http.ResponseWriter, r *http.Request) {
46 w.Header().Set("Content-Type", "application/json; charset=utf-8")
47 if err := json.NewEncoder(w).Encode(v); err != nil {
48 t.Fatal(err)
49 }
50 }
51}
52
53func readJSON(t *testing.T, ptr interface{}, expected interface{}) http.HandlerFunc {
54 return func(w http.ResponseWriter, r *http.Request) {

Callers 1

TestClientJSONFunction · 0.70

Calls 4

EncodeMethod · 0.80
FatalMethod · 0.80
SetMethod · 0.65
HeaderMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…