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

Function decodeBody

script/ghmock/checker.go:232–238  ·  view source on GitHub ↗

decodeBody decodes a JSON body, keeping numbers exact.

(body []byte)

Source from the content-addressed store, hash-verified

230
231// decodeBody decodes a JSON body, keeping numbers exact.
232func decodeBody(body []byte) (any, error) {
233 var v any
234 if err := decodeJSON(bytes.TrimSpace(body), &v); err != nil {
235 return nil, err
236 }
237 return v, nil
238}
239
240// describeJSON names the kind of a decoded JSON value for messages.
241func describeJSON(v any) string {

Callers 3

trimGraphQLFunction · 0.85
scaffoldGraphQLFunction · 0.85
checkGraphQLResponseFunction · 0.85

Calls 1

decodeJSONFunction · 0.70

Tested by

no test coverage detected