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

[Question] Any Func Equivalent to This? #107

Closed
KiddoV opened this issue Jul 10, 2023 · 6 comments
Closed

[Question] Any Func Equivalent to This? #107

KiddoV opened this issue Jul 10, 2023 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@KiddoV
Copy link
Contributor

KiddoV commented Jul 10, 2023

Trying to find a util function equivalent to this:

// Check if value is zero of its type. string => "", number => 0, pointer => nil, etc...
reflect.ValueOf(anyVal).IsZero()

Can you point me to the right one?
Thanks

@inhere
Copy link
Member

inhere commented Jul 11, 2023

goutil.IsEmpty(v any)

@inhere inhere added the question Further information is requested label Jul 11, 2023
@KiddoV KiddoV closed this as completed Jul 11, 2023
@KiddoV
Copy link
Contributor Author

KiddoV commented Jul 11, 2023

That's explained why I didn't see it. Was looking for something like goutil.IsZero.
Thanks!

@inhere
Copy link
Member

inhere commented Jul 11, 2023

... 😄 I will add a alias func goutil.IsZero:

// IsZero value check, alias of the IsEmpty()
var IsZero = IsEmpty

@KiddoV
Copy link
Contributor Author

KiddoV commented Jul 11, 2023

I don't see that alias func goutil.IsZero is it in the same package?

@inhere
Copy link
Member

inhere commented Jul 11, 2023

Will release on next version.

@KiddoV
Copy link
Contributor Author

KiddoV commented Jul 11, 2023

Good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants