cast icon indicating copy to clipboard operation
cast copied to clipboard

FeatureRequest: `ToBool` add `int*` support

Open hxzhao527 opened this issue 3 years ago • 1 comments

https://github.com/spf13/cast/blob/88075729b052bca4b8b6c31bf198db2fe6c9da93/caste.go#L81-L99

there only assert type int, no int8, int16, int32, int64, uint ...

could we add these type case?

hxzhao527 avatar Jan 21 '22 08:01 hxzhao527

I got the same problem today as I used redismock which only return value in type int64, and couldn't convert to bool. So I have made a PR for that, I will link the PR to this issue for further discuss and review on this matter: https://github.com/spf13/cast/pull/135

hungnl-dev avatar Mar 01 '22 10:03 hungnl-dev