From b1d5548fa777a876b91cb15e9967427f0e5a8c84 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 19 Mar 2020 20:00:32 -0700 Subject: [PATCH] tailcfg: make NodeKey.IsZero have a value receiver --- tailcfg/tailcfg.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index 8804557c4..715ec2df1 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -467,9 +467,9 @@ func (k *NodeKey) UnmarshalText(text []byte) error { return nil } -func (k *NodeKey) IsZero() bool { - z := NodeKey{} - return bytes.Equal(k[:], z[:]) +// IsZero reports whether k is the NodeKey zero value. +func (k NodeKey) IsZero() bool { + return k == NodeKey{} } func (id ID) String() string { return fmt.Sprintf("id:%x", int64(id)) }