| 1 | package unstablescip-go gomod github.com/pelletier/go-toml/v2 . `github.com/pelletier/go-toml/v2/unstable`/ |
| 2 | |
| 3 | // Unmarshaler is implemented by types that can unmarshal a TOML description |
| 4 | // of themselves. The input is a valid TOML document containing the relevant |
| 5 | // portion of the parsed document. |
| 6 | // |
| 7 | // For tables (including split tables defined in multiple places), the data |
| 8 | // contains the raw key-value bytes from the original document with adjusted |
| 9 | // table headers to be relative to the unmarshaling target. |
| 10 | type Unmarshalerscip-go gomod github.com/pelletier/go-toml/v2 . `github.com/pelletier/go-toml/v2/unstable`/Unmarshaler# interface { |
| 11 | UnmarshalTOMLscip-go gomod github.com/pelletier/go-toml/v2 . `github.com/pelletier/go-toml/v2/unstable`/Unmarshaler#UnmarshalTOML.(data []byte) error |
| 12 | } |
| 13 | |
| 14 | // RawMessage is a raw encoded TOML value. It implements Unmarshaler and can |
| 15 | // be used to delay TOML decoding or capture raw content. |
| 16 | // |
| 17 | // Example usage: |
| 18 | // |
| 19 | // type Config struct { |
| 20 | // Plugin RawMessage `toml:"plugin"` |
| 21 | // } |
| 22 | // |
| 23 | // var cfg Config |
| 24 | // toml.NewDecoder(r).EnableUnmarshalerInterface().Decode(&cfg) |
| 25 | // // cfg.Plugin now contains the raw TOML bytes for [plugin] |
| 26 | type RawMessagescip-go gomod github.com/pelletier/go-toml/v2 . `github.com/pelletier/go-toml/v2/unstable`/RawMessage# []byte |
| 27 | |
| 28 | // UnmarshalTOML implements Unmarshaler. |
| 29 | func (m *RawMessagescip-go gomod github.com/pelletier/go-toml/v2 . `github.com/pelletier/go-toml/v2/unstable`/RawMessage#) UnmarshalTOMLscip-go gomod github.com/pelletier/go-toml/v2 . `github.com/pelletier/go-toml/v2/unstable`/RawMessage#UnmarshalTOML().(data []byte) error { |
| 30 | *m = append((*m)[:0], data...) |
| 31 | return nil |
| 32 | } |