MCPcopy Index your code
hub / github.com/go-openapi/jsonpointer / extractFooKeyIndex

Function extractFooKeyIndex

pointer_test.go:517–531  ·  view source on GitHub ↗
(t *testing.T, index int)

Source from the content-addressed store, hash-verified

515}
516
517func extractFooKeyIndex(t *testing.T, index int) any {
518 t.Helper()
519
520 asMap, ok := testDocumentJSON(t).(map[string]any)
521 require.TrueT(t, ok)
522
523 // {"foo": [ ... ] }
524 bbb, ok := asMap["foo"]
525 require.TrueT(t, ok)
526
527 asArray, ok := bbb.([]any)
528 require.TrueT(t, ok)
529
530 return asArray[index]
531}
532
533func TestObject(t *testing.T) {
534 t.Parallel()

Callers 1

TestOtherThingsFunction · 0.85

Calls 1

testDocumentJSONFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…