add helper to check for zero uuid

This commit is contained in:
Denys Smirnov 2016-10-17 17:12:29 +03:00
parent 6f59d604fc
commit 94acb6ee4a

View File

@ -25,8 +25,9 @@ var zeroUUID UUID
type UUID [UUIDSize]byte
func (id UUID) IsZero() bool { return id == zeroUUID }
func (id UUID) String() string {
if id == zeroUUID {
if id.IsZero() {
return "<zero>"
}
buf := make([]byte, UUIDSize*2+4)