MCPcopy
hub / github.com/expr-lang/expr / isList

Function isList

internal/testify/assert/assertions.go:1108–1115  ·  view source on GitHub ↗

isList checks that the provided value is array or slice.

(t TestingT, list interface{}, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

1106
1107// isList checks that the provided value is array or slice.
1108func isList(t TestingT, list interface{}, msgAndArgs ...interface{}) (ok bool) {
1109 kind := reflect.TypeOf(list).Kind()
1110 if kind != reflect.Array && kind != reflect.Slice {
1111 return Fail(t, fmt.Sprintf("%q has an unsupported type %s, expecting array or slice", list, kind),
1112 msgAndArgs...)
1113 }
1114 return true
1115}
1116
1117// diffLists diffs two arrays/slices and returns slices of elements that are only in A and only in B.
1118// If some element is present multiple times, each instance is counted separately (e.g. if something is 2x in A and

Callers 1

ElementsMatchFunction · 0.85

Calls 2

SprintfMethod · 0.80
FailFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…