tailscale/cmd/viewer
Andrew Dunham d52ae45e9b cmd/cloner: deep-clone pointer elements in map-of-slice values
The cloner's codegen for map[K][]*V fields was doing a shallow
append (copying pointer values) instead of cloning each element.
This meant that cloned structs aliased the original's pointed-to
values through the map's slice entries.

Mirror the existing standalone-slice logic that checks
ContainsPointers(sliceType.Elem()) and generates per-element
cloning for pointer, interface, and struct types.

Regenerate net/dns and tailcfg which both had affected
map[...][]*dnstype.Resolver fields.

Fixes #19284

Signed-off-by: Andrew Dunham <andrew@tailscale.com>
2026-04-17 11:36:05 -04:00
..
tests cmd/cloner: deep-clone pointer elements in map-of-slice values 2026-04-17 11:36:05 -04:00
viewer_test.go cmd/cloner, cmd/viewer: handle named map/slice types with Clone/View methods 2026-04-05 20:20:32 -07:00
viewer.go cmd/cloner, cmd/viewer: handle named map/slice types with Clone/View methods 2026-04-05 20:20:32 -07:00