MCPcopy Index your code
hub / github.com/google/go-jsonnet / index

Method index

value.go:293–298  ·  view source on GitHub ↗
(i *interpreter, index int)

Source from the content-addressed store, hash-verified

291}
292
293func (arr *valueArray) index(i *interpreter, index int) (value, error) {
294 if 0 <= index && index < arr.length() {
295 return i.evaluatePV(arr.elements[index])
296 }
297 return nil, i.Error(fmt.Sprintf("Index %d out of bounds, not within [0, %v)", index, arr.length()))
298}
299
300func (arr *valueArray) length() int {
301 return len(arr.elements)

Callers

nothing calls this directly

Calls 3

lengthMethod · 0.95
evaluatePVMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected