From 4cc0ed67f9c49091bdc3c6396886e27dd461e958 Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 21 Sep 2020 12:19:24 -0700 Subject: [PATCH] tailcfg: add MachineKey.IsZero Signed-off-by: Josh Bleecher Snyder --- tailcfg/tailcfg.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index ac8c40182..087375c31 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -623,6 +623,9 @@ func (k *NodeKey) UnmarshalText(text []byte) error { return keyUnmarshalText(k[: // IsZero reports whether k is the zero value. func (k NodeKey) IsZero() bool { return k == NodeKey{} } +// IsZero reports whether k is the zero value. +func (k MachineKey) IsZero() bool { return k == MachineKey{} } + func (k DiscoKey) String() string { return fmt.Sprintf("discokey:%x", k[:]) } func (k DiscoKey) MarshalText() ([]byte, error) { return keyMarshalText("discokey:", k), nil } func (k *DiscoKey) UnmarshalText(text []byte) error { return keyUnmarshalText(k[:], "discokey:", text) }