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

Function describeJSON

script/ghmock/checker.go:241–258  ·  view source on GitHub ↗

describeJSON names the kind of a decoded JSON value for messages.

(v any)

Source from the content-addressed store, hash-verified

239
240// describeJSON names the kind of a decoded JSON value for messages.
241func describeJSON(v any) string {
242 switch v.(type) {
243 case nil:
244 return "null"
245 case string:
246 return "a string"
247 case json.Number, float64:
248 return "a number"
249 case bool:
250 return "a boolean"
251 case []any:
252 return "a list"
253 case map[string]any:
254 return "an object"
255 default:
256 return fmt.Sprintf("%T", v)
257 }
258}
259
260// listNames joins names for messages, shortening long lists.
261func listNames(names []string, limit int) string {

Callers 5

checkGraphQLResponseFunction · 0.85
checkErrorsMethod · 0.85
checkObjectMethod · 0.85
checkValueMethod · 0.85
checkScalarMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected