@ -219,9 +219,11 @@ func (src *DNSConfig) Clone() *DNSConfig {
}
dst := new ( DNSConfig )
* dst = * src
dst . Resolvers = make ( [ ] * dnstype . Resolver , len ( src . Resolvers ) )
for i := range dst . Resolvers {
dst . Resolvers [ i ] = src . Resolvers [ i ] . Clone ( )
if src . Resolvers != nil {
dst . Resolvers = make ( [ ] * dnstype . Resolver , len ( src . Resolvers ) )
for i := range dst . Resolvers {
dst . Resolvers [ i ] = src . Resolvers [ i ] . Clone ( )
}
}
if dst . Routes != nil {
dst . Routes = map [ string ] [ ] * dnstype . Resolver { }
@ -229,9 +231,11 @@ func (src *DNSConfig) Clone() *DNSConfig {
dst . Routes [ k ] = append ( [ ] * dnstype . Resolver { } , src . Routes [ k ] ... )
}
}
dst . FallbackResolvers = make ( [ ] * dnstype . Resolver , len ( src . FallbackResolvers ) )
for i := range dst . FallbackResolvers {
dst . FallbackResolvers [ i ] = src . FallbackResolvers [ i ] . Clone ( )
if src . FallbackResolvers != nil {
dst . FallbackResolvers = make ( [ ] * dnstype . Resolver , len ( src . FallbackResolvers ) )
for i := range dst . FallbackResolvers {
dst . FallbackResolvers [ i ] = src . FallbackResolvers [ i ] . Clone ( )
}
}
dst . Domains = append ( src . Domains [ : 0 : 0 ] , src . Domains ... )
dst . Nameservers = append ( src . Nameservers [ : 0 : 0 ] , src . Nameservers ... )
@ -365,9 +369,11 @@ func (src *DERPRegion) Clone() *DERPRegion {
}
dst := new ( DERPRegion )
* dst = * src
dst . Nodes = make ( [ ] * DERPNode , len ( src . Nodes ) )
for i := range dst . Nodes {
dst . Nodes [ i ] = src . Nodes [ i ] . Clone ( )
if src . Nodes != nil {
dst . Nodes = make ( [ ] * DERPNode , len ( src . Nodes ) )
for i := range dst . Nodes {
dst . Nodes [ i ] = src . Nodes [ i ] . Clone ( )
}
}
return dst
}
@ -444,9 +450,11 @@ func (src *SSHRule) Clone() *SSHRule {
if dst . RuleExpires != nil {
dst . RuleExpires = ptr . To ( * src . RuleExpires )
}
dst . Principals = make ( [ ] * SSHPrincipal , len ( src . Principals ) )
for i := range dst . Principals {
dst . Principals [ i ] = src . Principals [ i ] . Clone ( )
if src . Principals != nil {
dst . Principals = make ( [ ] * SSHPrincipal , len ( src . Principals ) )
for i := range dst . Principals {
dst . Principals [ i ] = src . Principals [ i ] . Clone ( )
}
}
dst . SSHUsers = maps . Clone ( src . SSHUsers )
dst . Action = src . Action . Clone ( )