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

Method Decode

unmarshaler.go:171–181  ·  view source on GitHub ↗

Decode the whole content of r into v. By default, values in the document that don't exist in the target Go value are ignored. See Decoder.DisallowUnknownFields() to change this behavior. When a TOML local date, time, or date-time is decoded into a time.Time, its value is represented in time.Local

(v interface{})

Source from the content-addressed store, hash-verified

169// Inline Table -> same as Table
170// Array of Tables -> same as Array and Table
171func (d *Decoder) Decode(v interface{}) error {
172 b, err := io.ReadAll(d.r)
173 if err != nil {
174 return fmt.Errorf("toml: %w", err)
175 }
176
177 dec := getDecoder(d.strict, d.unmarshalerInterface)
178 err = dec.unmarshal(b, v)
179 putDecoder(dec)
180 return err
181}
182
183// pathPart is one part of the key path leading to a value. Parts that come
184// from the current table header only carry a name; parts that come from the

Calls 3

getDecoderFunction · 0.85
putDecoderFunction · 0.85
unmarshalMethod · 0.80