-
Notifications
You must be signed in to change notification settings - Fork 3.4k
multicast: use Go 1.20 slice-to-array conversion for SolicitedNodeMaddr() #40591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multicast: use Go 1.20 slice-to-array conversion for SolicitedNodeMaddr() #40591
Conversation
…dr() Go 1.20 introduced slice-to-array conversions, which allow directly casting a slice to an array. This commit updates the Address.SolicitedNodeMaddr() method to use the cleaner [16]byte(slice) syntax instead of *(*[16]byte)(slice). Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suchit07-git thanks for the PR. Could you also apply the same change at
cilium/pkg/multicast/multicast_test.go
Line 70 in cab0cce
return Address(netip.AddrFrom16(*(*[16]byte)(maddr))).SolicitedNodeMaddr() |
Use Go 1.20 slice-to-array conversion syntax in randMaddr() function Signed-off-by: Suchit Karunakaran <suchitkarunakaran@gmail.com>
Head branch was pushed to by a user without write access
Done @tklauser |
/test |
Go 1.20 introduced slice-to-array conversions, which allow directly casting a slice to an array. This commit updates the Address.SolicitedNodeMaddr() method to use the cleaner [16]byte(slice) syntax instead of *(*[16]byte)(slice) as mentioned in the TODO.