MCPcopy
hub / github.com/google/go-jsonnet / builtinFlatMapArray

Function builtinFlatMapArray

builtins.go:352–359  ·  view source on GitHub ↗

builtinFlatMapArray is like builtinFlatMap, but only accepts array as the arrv value. Desugared comprehensions contain a call to this function, rather than builtinFlatMap, so that a better error message is printed when the comprehension would iterate over a non-array.

(i *interpreter, funcv, arrv value)

Source from the content-addressed store, hash-verified

350// than builtinFlatMap, so that a better error message is printed when the
351// comprehension would iterate over a non-array.
352func builtinFlatMapArray(i *interpreter, funcv, arrv value) (value, error) {
353 switch arrv := arrv.(type) {
354 case *valueArray:
355 return builtinFlatMap(i, funcv, arrv)
356 default:
357 return nil, i.typeErrorSpecific(arrv, &valueArray{})
358 }
359}
360
361func joinArrays(i *interpreter, sep *valueArray, arr *valueArray) (value, error) {
362 result := make([]*cachedThunk, 0, arr.length())

Callers

nothing calls this directly

Calls 2

builtinFlatMapFunction · 0.85
typeErrorSpecificMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…