ReadSection deserializes the named section into v.
(name string, v any)
| 58 | |
| 59 | // ReadSection deserializes the named section into v. |
| 60 | func (d *Decoder) ReadSection(name string, v any) error { |
| 61 | data, ok := d.sections[name] |
| 62 | if !ok { |
| 63 | return fmt.Errorf("copyover: section %q not found", name) |
| 64 | } |
| 65 | if err := json.Unmarshal(data, v); err != nil { |
| 66 | return fmt.Errorf("copyover: unmarshal section %q: %w", name, err) |
| 67 | } |
| 68 | return nil |
| 69 | } |
| 70 | |
| 71 | var registry []Contributor |
| 72 |
no outgoing calls