MCPcopy
hub / github.com/harness/harness / writeJSON

Function writeJSON

app/api/render/render.go:154–162  ·  view source on GitHub ↗
(w http.ResponseWriter, v any)

Source from the content-addressed store, hash-verified

152}
153
154func writeJSON(w http.ResponseWriter, v any) {
155 enc := json.NewEncoder(w)
156 if indent {
157 enc.SetIndent("", " ")
158 }
159 if err := enc.Encode(v); err != nil {
160 log.Err(err).Msgf("Failed to write json encoding to response body.")
161 }
162}

Callers 1

JSONFunction · 0.85

Calls 3

EncodeMethod · 0.95
MsgfMethod · 0.80
ErrMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…