summaryrefslogtreecommitdiffhomepage
path: root/tailcfg/tailcfg.go
diff options
context:
space:
mode:
Diffstat (limited to 'tailcfg/tailcfg.go')
-rw-r--r--tailcfg/tailcfg.go16
1 files changed, 2 insertions, 14 deletions
diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go
index 0e98f2a72..912005a6c 100644
--- a/tailcfg/tailcfg.go
+++ b/tailcfg/tailcfg.go
@@ -4,6 +4,8 @@
package tailcfg
+//go:generate go run tailscale.com/cmd/cloner -type=User,Node,Hostinfo,NetInfo -output=tailcfg_clone.go
+
import (
"bytes"
"errors"
@@ -371,20 +373,6 @@ func (ni *NetInfo) BasicallyEqual(ni2 *NetInfo) bool {
ni.LinkType == ni2.LinkType
}
-// Clone makes a deep copy of Hostinfo.
-// The result aliases no memory with the original.
-//
-// TODO: use cmd/cloner, reconcile len(0) vs. nil.
-func (h *Hostinfo) Clone() (res *Hostinfo) {
- res = new(Hostinfo)
- *res = *h
-
- res.RoutableIPs = append([]wgcfg.CIDR{}, h.RoutableIPs...)
- res.Services = append([]Service{}, h.Services...)
- res.NetInfo = h.NetInfo.Clone()
- return res
-}
-
// Equal reports whether h and h2 are equal.
func (h *Hostinfo) Equal(h2 *Hostinfo) bool {
if h == nil && h2 == nil {