mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-16 11:38:23 +00:00
types/netmap,*: pass around UserProfiles as views (pointers) instead
Smaller. Updates tailscale/corp#26058 (@andrew-d noticed during this) Change-Id: Id33cddd171aaf8f042073b6d3c183b0a746e9931 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
1047d11102
commit
9706c9f4ff
@@ -1052,13 +1052,13 @@ func TestWhoIs(t *testing.T) {
|
||||
Addresses: []netip.Prefix{netip.MustParsePrefix("100.200.200.200/32")},
|
||||
}).View(),
|
||||
},
|
||||
UserProfiles: map[tailcfg.UserID]tailcfg.UserProfile{
|
||||
10: {
|
||||
UserProfiles: map[tailcfg.UserID]tailcfg.UserProfileView{
|
||||
10: (&tailcfg.UserProfile{
|
||||
DisplayName: "Myself",
|
||||
},
|
||||
20: {
|
||||
}).View(),
|
||||
20: (&tailcfg.UserProfile{
|
||||
DisplayName: "Peer",
|
||||
},
|
||||
}).View(),
|
||||
},
|
||||
})
|
||||
tests := []struct {
|
||||
@@ -2754,12 +2754,12 @@ func TestTCPHandlerForDstWithVIPService(t *testing.T) {
|
||||
tailcfg.NodeAttrServiceHost: []tailcfg.RawMessage{tailcfg.RawMessage(svcIPMapJSON)},
|
||||
},
|
||||
}).View(),
|
||||
UserProfiles: map[tailcfg.UserID]tailcfg.UserProfile{
|
||||
tailcfg.UserID(1): {
|
||||
UserProfiles: map[tailcfg.UserID]tailcfg.UserProfileView{
|
||||
tailcfg.UserID(1): (&tailcfg.UserProfile{
|
||||
LoginName: "someone@example.com",
|
||||
DisplayName: "Some One",
|
||||
ProfilePicURL: "https://example.com/photo.jpg",
|
||||
},
|
||||
}).View(),
|
||||
},
|
||||
},
|
||||
)
|
||||
|
Reference in New Issue
Block a user