MCPcopy Create free account
hub / github.com/devspace-sh/devspace / keyIndex

Method keyIndex

pkg/util/strvals/strvals.go:299–309  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

297}
298
299func (t *parser) keyIndex() (int, error) {
300 // First, get the key.
301 stop := runeSet([]rune{']'})
302 v, _, err := runesUntil(t.sc, stop)
303 if err != nil {
304 return 0, err
305 }
306 // v should be the index
307 return strconv.Atoi(string(v))
308
309}
310func (t *parser) listItem(list []interface{}, i int) ([]interface{}, error) {
311 if i < 0 {
312 return list, fmt.Errorf("negative %d index not allowed", i)

Callers 2

keyMethod · 0.95
listItemMethod · 0.95

Calls 2

runeSetFunction · 0.85
runesUntilFunction · 0.85

Tested by

no test coverage detected