From the v1.0.0 release, the cancelFunc is introduced during FSM init with context. However, we had decoupled the callback function. When the unit test of callback may panic since it may cause the cancelFunc is not assignable.
For example:
create a callback function and do the unit test with a callback function. The input event may not have cancelFunc and caused panic.
P.S: Here is the event caused the panic.
Suggestion:
- We may need to skip the
cancelFunc if it is nil to give decouple when testing the callback function here.
- We may need to public the
cancelFunc to CancelFunc or a set function to assign the cancelFunc.
From the v1.0.0 release, the
cancelFuncis introduced during FSM init with context. However, we had decoupled the callback function. When the unit test of callback may panic since it may cause thecancelFuncis not assignable.For example:
create a callback function and do the unit test with a callback function. The input event may not have cancelFunc and caused panic.
P.S: Here is the event caused the panic.
Suggestion:
cancelFuncif it is nil to give decouple when testing the callback function here.cancelFuncto CancelFunc or a set function to assign thecancelFunc.