Skip to content

Commit

Permalink
netutil: add doc
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Apr 7, 2023
1 parent 6475e22 commit 442155a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/netutil/netutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func SortIPAddrs(addrs []net.IPAddr, preferIPv6 bool) {
})
}

// SortNetIPAddrs sorts addrs in accordance with the protocol preferences.
// Invalid addresses are sorted near the end. Zones are ignored.
func SortNetIPAddrs(addrs []netip.Addr, preferIPv6 bool) {
l := len(addrs)
if l <= 1 {
Expand Down

0 comments on commit 442155a

Please sign in to comment.