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

Method index

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

Source from the content-addressed store, hash-verified

90}
91
92func (s *valueFlatString) index(i *interpreter, index int) (value, error) {
93 if 0 <= index && index < s.length() {
94 return makeValueString(string(s.value[index])), nil
95 }
96 return nil, i.Error(fmt.Sprintf("Index %d out of bounds, not within [0, %v)", index, s.length()))
97}
98
99func (s *valueFlatString) getRunes() []rune {
100 return s.value

Callers

nothing calls this directly

Calls 3

lengthMethod · 0.95
makeValueStringFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected