MCPcopy Create free account
hub / github.com/codealong-dev/ride-sharing / writeJSON

Function writeJSON

services/api-gateway/json.go:8–12  ·  view source on GitHub ↗
(w http.ResponseWriter, status int, data any)

Source from the content-addressed store, hash-verified

6)
7
8func writeJSON(w http.ResponseWriter, status int, data any) error {
9 w.Header().Set("Content-Type", "application/json")
10 w.WriteHeader(status)
11 return json.NewEncoder(w).Encode(data)
12}

Callers 2

handleTripStartFunction · 0.70
handleTripPreviewFunction · 0.70

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected