Skip to content

Should cancelFunc be public? #96

Open
@LucasChenPandaTW

Description

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:

  1. We may need to skip the cancelFunc if it is nil to give decouple when testing the callback function here.
  2. We may need to public the cancelFunc to CancelFunc or a set function to assign the cancelFunc.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions