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{})
| 169 | // Inline Table -> same as Table |
| 170 | // Array of Tables -> same as Array and Table |
| 171 | func (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 |