Skip to content

Fix EventState Exclusive parsing interface{} to *bool error #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 18, 2022

Conversation

VicNgu
Copy link
Contributor

@VicNgu VicNgu commented Jan 13, 2022

What this PR does / why we need it:
Currently, when the exclusive flag is provided, the code will panic due to interface{} unable to be parsed into a (*bool). This change defaults the exclusive flag to true and sets the value if it is provided as a bool.

Copy link
Member

@ricardozanini ricardozanini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks! Can you please add a unit test to verify this change?

Ideally, with an example that would fire a nil exception.

@VicNgu
Copy link
Contributor Author

VicNgu commented Jan 14, 2022

Many thanks! Can you please add a unit test to verify this change?

Ideally, with an example that would fire a nil exception.

Added two test cases and updated the existing one.
The existing test case did not have the exclusive flag set, so it should default to true.
Other two test cases explicitly sets exclusive to true and false.

@ricardozanini ricardozanini merged commit 397ae25 into serverlessworkflow:main Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants