Skip to content
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

fix: factory array default value #45

Merged
merged 2 commits into from
Dec 15, 2023
Merged

Conversation

muktihari
Copy link
Owner

The changes:

  • Previously in the factory on RecordMesg, compressed_speed_distance's Value was uint8(255), this is not correct since the field is an array [3]uint8 field, now it is changed to []uint8(nil). This validator will handle this gracefully, while it is nil value but not a nil type so validator will not complain, and since it is a nil value, nothing will be written to the file on encoding process (marshal).
  • We use slice as it is convenient to work with slices and for simplicity, it's user responsibility to validate the size of the slice, for the example above, it should match len 3. We encourage user to write a good code rather than having bunch of validators to validate all possibilities, we will provide verbose comment in our type declaration for helping user writing the good code.

Notes:

  • This update should not change the current behaviour in our SDK.
  • Users are less likely to be affected and if it does, it should be a minor.
  • This update give us more proper array handling.

@muktihari muktihari added the chore update not related to the functionality of the sdk, e.g. update workflow label Dec 15, 2023
@muktihari muktihari self-assigned this Dec 15, 2023
@muktihari muktihari merged commit 91247f2 into master Dec 15, 2023
1 check passed
@muktihari muktihari deleted the fix/factory-array-default-value branch December 15, 2023 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore update not related to the functionality of the sdk, e.g. update workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant