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

Function missingResponse

script/ghmock/server.go:328–334  ·  view source on GitHub ↗

missingResponse is what gh gets for a request with no stored response. Its message names the request so the caller knows what to add.

(name string, isGraphQL bool)

Source from the content-addressed store, hash-verified

326// missingResponse is what gh gets for a request with no stored response. Its
327// message names the request so the caller knows what to add.
328func missingResponse(name string, isGraphQL bool) (int, any) {
329 msg := "ghmock: no response for " + name
330 if isGraphQL {
331 return http.StatusOK, map[string]any{"errors": []map[string]string{{"message": msg}}}
332 }
333 return http.StatusNotFound, map[string]string{"message": msg}
334}
335
336func writeJSON(w http.ResponseWriter, status int, payload any) {
337 w.Header().Set("Content-Type", "application/json; charset=utf-8")

Callers 1

ServeHTTPMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected