doc: update README to document *bool behavior#51
Open
fchikwekwe wants to merge 1 commit intocreasty:masterfrom
Open
doc: update README to document *bool behavior#51fchikwekwe wants to merge 1 commit intocreasty:masterfrom
fchikwekwe wants to merge 1 commit intocreasty:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #51 +/- ##
=======================================
Coverage 95.97% 95.97%
=======================================
Files 2 2
Lines 149 149
=======================================
Hits 143 143
Misses 3 3
Partials 3 3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
creasty
reviewed
Aug 13, 2024
| - Scalar types | ||
| - `int/8/16/32/64`, `uint/8/16/32/64`, `float32/64` | ||
| - `uintptr`, `bool`, `string` | ||
| - `bool` values declared as a `*bool` allow for an unset boolean type. This helps distinguish the case where a default true bool is set to `false`. |
Owner
There was a problem hiding this comment.
This is not exclusive to bool values.
Any scalar type can't distinguish an unspecified value from its zero value.
For int, an unspecified value means 0; For string, an empty string ("").
If we want to indicate this behavior in README, we might as well do with technicalities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
boolvalues that are unset (zero value isfalse) or have been set tofalseare indistinguishable from one another. As a result,boolvalues with defaulttruethat are set tofalseget overriden by the defaults library.If the user declares a
*boolin their struct, then there are three possible setting for boolean:true,falseand unset.Closes #49
Related to #50