MCPcopy Index your code
hub / github.com/golang/example / renderJSON

Function renderJSON

ragserver/ragserver/json.go:33–41  ·  view source on GitHub ↗

renderJSON renders 'v' as JSON and writes it as a response into w.

(w http.ResponseWriter, v any)

Source from the content-addressed store, hash-verified

31
32// renderJSON renders 'v' as JSON and writes it as a response into w.
33func renderJSON(w http.ResponseWriter, v any) {
34 js, err := json.Marshal(v)
35 if err != nil {
36 http.Error(w, err.Error(), http.StatusInternalServerError)
37 return
38 }
39 w.Header().Set("Content-Type", "application/json")
40 w.Write(js)
41}

Callers 1

queryHandlerMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…