MCPcopy
hub / github.com/pelletier/go-toml / currentKey

Method currentKey

unmarshaler.go:476–489  ·  view source on GitHub ↗

currentKey reconstructs the full TOML key being processed from the decoder's path. When withTableKey is true, d.path contains only the key-value parts (the table target is cached) and the table key is prepended.

(withTableKey bool)

Source from the content-addressed store, hash-verified

474// path. When withTableKey is true, d.path contains only the key-value parts
475// (the table target is cached) and the table key is prepended.
476func (d *decoder) currentKey(withTableKey bool) Key {
477 n := len(d.path)
478 if withTableKey {
479 n += len(d.tableKey)
480 }
481 key := make(Key, 0, n)
482 if withTableKey {
483 key = append(key, d.tableKey...)
484 }
485 for i := range d.path {
486 key = append(key, d.path[i].str())
487 }
488 return key
489}
490
491func (d *decoder) unmarshal(data []byte, v interface{}) error {
492 r := reflect.ValueOf(v)

Callers 1

contextualizeErrorMethod · 0.95

Calls 1

strMethod · 0.80

Tested by

no test coverage detected