Refactor socksaddr

This commit is contained in:
世界 2022-05-04 19:12:27 +08:00
parent 9378ae739c
commit b35c53ca8f
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
54 changed files with 1191 additions and 666 deletions

View file

@ -13,12 +13,8 @@ func LocalAddrs() ([]netip.Addr, error) {
if err != nil {
return nil, err
}
return common.Map(common.Filter(common.Map(interfaceAddrs, func(addr net.Addr) M.Addr {
return common.Map(interfaceAddrs, func(addr net.Addr) netip.Addr {
return M.AddrFromNetAddr(addr)
}), func(addr M.Addr) bool {
return addr != nil
}), func(it M.Addr) netip.Addr {
return it.Addr()
}), nil
}