Skip to content
This repository has been archived by the owner on May 25, 2023. It is now read-only.

Make IPSet a fmt.Stringer? #193

Open
josharian opened this issue Jun 29, 2021 · 3 comments
Open

Make IPSet a fmt.Stringer? #193

josharian opened this issue Jun 29, 2021 · 3 comments

Comments

@josharian
Copy link
Collaborator

@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.

@jxsl13
Copy link

jxsl13 commented Sep 23, 2021

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

@danderson
Copy link
Member

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

@josharian
Copy link
Collaborator Author

SGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants