Simplify slice to array conversion

This commit is contained in:
Oleksandr Redko
2025-08-10 20:06:28 +08:00
committed by 世界
parent e1dbcccab5
commit 76ee64ae50
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ func defaultRouteIP() (netip.Addr, error) {
for _, addr := range addrs {
ip := addr.(*net.IPNet).IP
if ip.To4() != nil {
return netip.AddrFrom4(*(*[4]byte)(ip)), nil
return netip.AddrFrom4([4]byte(ip)), nil
}
}