logtail: add PrivateID.IsZero method

This commit is contained in:
Brad Fitzpatrick 2020-04-27 07:33:23 -07:00
parent 9497921f52
commit 5d67365cc9
1 changed files with 3 additions and 0 deletions

View File

@ -55,6 +55,9 @@ func ParsePrivateID(s string) (PrivateID, error) {
return p, nil
}
// IsZero reports whether id is the zero value.
func (id PrivateID) IsZero() bool { return id == PrivateID{} }
func (id *PrivateID) UnmarshalText(s []byte) error {
b, err := hex.DecodeString(string(s))
if err != nil {