MCPcopy Create free account
hub / github.com/cli/cli / writeJSON

Function writeJSON

script/ghmock/server.go:336–340  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, payload any)

Source from the content-addressed store, hash-verified

334}
335
336func writeJSON(w http.ResponseWriter, status int, payload any) {
337 w.Header().Set("Content-Type", "application/json; charset=utf-8")
338 w.WriteHeader(status)
339 _ = json.NewEncoder(w).Encode(payload)
340}

Callers 1

ServeHTTPMethod · 0.85

Calls 1

SetMethod · 0.65

Tested by

no test coverage detected