ResetDict is like Reset, but also resets the dict.
(w io.Writer, dict map[string]int)
| 104 | |
| 105 | // ResetDict is like Reset, but also resets the dict. |
| 106 | func (e *Encoder) ResetDict(w io.Writer, dict map[string]int) { |
| 107 | e.ResetWriter(w) |
| 108 | e.flags = 0 |
| 109 | e.structTag = "" |
| 110 | e.dict = dict |
| 111 | } |
| 112 | |
| 113 | func (e *Encoder) WithDict(dict map[string]int, fn func(*Encoder) error) error { |
| 114 | oldDict := e.dict |