inetaf / netaddr

Network address types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Make IPSet a fmt.Stringer?

josharian opened this issue · comments

@Xe requested that IPSet be a fmt.Stringer. It's not obvious what a good representation would be, but having something to look at would be better than nothing. One option might be something like:

IPSet(127.0.0.0-127.0.0.255,192.168.1.5-192.168.1.5 without 127.0.0.1-127.0.0.2)

Other ideas welcomed.

why the without part if you could "simply" say 127.0.0.3-127.0.0.255?

Once minimized, the IPSet consists of only inclusive ranges, so the without part would never appear. Given that, a comma-separated list of IPRange's stringification seems like a fine string form. WDYT @josharian