Closed kevinburke1 closed 2 years ago
@kevinburkemeter since they are an array type you can just compare them with ==
. Any reason you can't do that here?
@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:
{{if .SomeUUID.IsZero}}
Some UUID is nil
{{end}}
+1 for the suggestion to add an IsZero
method.
Thanks for the recommendation @kevinburke1 , this has been contributed by @jordan-chalupka in #95, and is out for release in v4.2.0
.
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.