cmd/cloner: use maps.Clone and ptr.To

Updates #cleanup

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2023-08-20 13:16:06 -04:00
committed by Maisem Ali
parent 4511e7d64e
commit 8a5ec72c85
8 changed files with 45 additions and 96 deletions

View File

@@ -6,6 +6,7 @@
package ipn
import (
"maps"
"net/netip"
"tailscale.com/tailcfg"
@@ -73,12 +74,7 @@ func (src *ServeConfig) Clone() *ServeConfig {
dst.Web[k] = v.Clone()
}
}
if dst.AllowFunnel != nil {
dst.AllowFunnel = map[HostPort]bool{}
for k, v := range src.AllowFunnel {
dst.AllowFunnel[k] = v
}
}
dst.AllowFunnel = maps.Clone(src.AllowFunnel)
return dst
}