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

reflectx: IsNil 方法 #145

Closed
flycash opened this issue Feb 3, 2023 · 0 comments · Fixed by #150
Closed

reflectx: IsNil 方法 #145

flycash opened this issue Feb 3, 2023 · 0 comments · Fixed by #150
Labels
Milestone

Comments

@flycash
Copy link
Contributor

flycash commented Feb 3, 2023

仅限中文

使用场景

在自带的反射包里面,IsNil 只能在特定类型是调用,例如说 channel, map 之类的。如果在其他类型上调用,例如说基本类型,那么会引起 panic。

这种语义十分违背直觉,因为我们会预期说如果类型不对,那么我们就返回 false。

所以现在我们尝试在 ekit 里面提供类似的方法 IsNil。

那么对于这些会引起 panic 的类型,我们就返回一个false。

@flycash flycash added the 简单 label Feb 3, 2023
@flycash flycash added this to the v0.0.7 milestone Feb 3, 2023
@flycash flycash linked a pull request Feb 6, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant