EncodeFast will unmarshal the data if fast marshall is available. This function can be used if you want to be sure the fast marshal is used or in testing. If you would like to have fallback to encoding/json you can use the regular Encode() method.
out.Reset() err = enc.EncodeFast(record) require.NoError(t, err) require.NotEqual(t, 0, out.Len(), "encoded buffer size should not be 0")
require.NoError(t, err, "error did not clear as expected.") err = enc.EncodeFast(newLogRecord()) require.Error(t, err, "excpected error from encoder on type that isn't fast") }
EncodeFast is referenced in 2 repositoriesgithub.com/pquerna/ffjson
- 2 references in tests/ff_test.go
- 1 reference in recording/recording.go