Nick Khyl 20d6058e7b
cmd/{cloner,viewer},types/views: add viewer and cloner support for slices and maps of both structs (rather than pointers to structs) and views
In this PR we add viewer/cloner codegen support for the following field types, where View is an existing,
likely generated, view type and T is a struct (rather than a pointer to struct).
- []T
- []View
- map[K]View

To support []T, we introduce the generic view type view.ValueSliceView[T, P, V].
Here, P (i.e. *T) implements ViewCloner[*T, V], and V is the concrete view type for T.

For the slices and maps of views we use existing views.Slice and view.Map view types.

This is mostly done in a preparation for generating netmap.NetworkMapView.

Updates #12614
Updates tailscale/corp#27502

Signed-off-by: Nick Khyl <nickk@tailscale.com>
2025-04-17 17:57:50 -05:00
..
2025-01-07 13:05:37 -08:00
2023-08-03 13:00:45 -07:00
2025-04-14 14:06:56 -07:00
2024-04-16 15:32:38 -07:00
2025-03-29 11:02:42 -07:00