DecodeFast will unmarshal the data if fast unmarshal is available. This function can be used if you want to be sure the fast unmarshal is used or in testing. If you would like to have fallback to encoding/json you can use the regular Decode() method.
(data []byte, v interface{})
| 79 | // If you would like to have fallback to encoding/json you can use the |
| 80 | // regular Decode() method. |
| 81 | func (d *Decoder) DecodeFast(data []byte, v interface{}) error { |
| 82 | f, ok := v.(unmarshalFaster) |
| 83 | if !ok { |
| 84 | return errors.New("ffjson unmarshal not available for type " + reflect.TypeOf(v).String()) |
| 85 | } |
| 86 | if d.fs == nil { |
| 87 | d.fs = fflib.NewFFLexer(data) |
| 88 | } else { |
| 89 | d.fs.Reset(data) |
| 90 | } |
| 91 | return f.UnmarshalJSONFFLexer(d.fs, fflib.FFParse_map_start) |
| 92 | } |
nothing calls this directly
no test coverage detected