-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add BoolGetter and BoolLikeGetter for IsBool
Introduces two new types, BoolGetter and BoolLikeGetter, as prerequisites for the upcoming IsBool Converter feature. BoolGetter is designed to retrieve a bool value directly and will return a TypeError if the type doesn't match. It only accepts: 1. Native bool 2. pcommon.ValueTypeBool BoolLikeGetter will attempt to convert the underlying value to a bool, if possible, and return an error for incompatible types. It accepts bool, int, int64, string, and float64, as well as corresponding pcommon.ValueTypes. If the received pointer is nil, it will return nil.
- Loading branch information
1 parent
1d4cf91
commit 8e9a07f
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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