We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Right now to tell if a UUID is entirely empty, you need to do this fairly clunky operation:
if bytes.Equal(myUUID[:], uuid.Nil[:]) { ... }
It might be nice to add IsZero() - matching the API for time.Time - that will handle this for you.
IsZero()
time.Time
The text was updated successfully, but these errors were encountered:
@kevinburkemeter since they are an array type you can just compare them with ==. Any reason you can't do that here?
==
Sorry, something went wrong.
@theckman You can't always count on having access to the uuid package, for example within Go templates, it would be nice to do this:
uuid
{{if .SomeUUID.IsZero}} Some UUID is nil {{end}}
+1 for the suggestion to add an IsZero method.
IsZero
Thanks for the recommendation @kevinburke1 , this has been contributed by @jordan-chalupka in #95, and is out for release in v4.2.0.
v4.2.0
No branches or pull requests
Right now to tell if a UUID is entirely empty, you need to do this fairly clunky operation:
It might be nice to add
IsZero()
- matching the API fortime.Time
- that will handle this for you.The text was updated successfully, but these errors were encountered: