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

Method stringMapKey

unmarshaler.go:366–372  ·  view source on GitHub ↗

stringMapKey returns a reflect.Value holding the given string, reusing the same allocation every time. The result must be used (the map operation performed) before any recursive call, which may overwrite the buffer.

(s string)

Source from the content-addressed store, hash-verified

364// same allocation every time. The result must be used (the map operation
365// performed) before any recursive call, which may overwrite the buffer.
366func (d *decoder) stringMapKey(s string) reflect.Value {
367 if !d.strKey.IsValid() {
368 d.strKey = reflect.New(stringType).Elem()
369 }
370 d.strKey.SetString(s)
371 return d.strKey
372}
373
374// joinPath builds the NUL-joined representation of a key path in the
375// decoder's scratch buffer. The result is only valid until the next call.

Callers 3

storeSlotMethod · 0.95
walkTableMethod · 0.95
descendMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected