-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPBlock convenience functions #76
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring for renamed functions has to be updated too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests for exported functions in ipblock_test.go
pkg/netset/ipblock.go
Outdated
if len(b.Split()) != 1 || len(other.Split()) != 1 { | ||
return false, fmt.Errorf("both ipblocks should be a single IP range") | ||
} | ||
return (!b.Overlap(other) && len(b.Union(other).Split()) == 1), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if len(b.Split()) != 1 || len(other.Split()) != 1 { | |
return false, fmt.Errorf("both ipblocks should be a single IP range") | |
} | |
return (!b.Overlap(other) && len(b.Union(other).Split()) == 1), nil | |
if b.ipRange.NumIntervals() != 1 || other.ipRange.NumIntervals() != 1 { | |
return false, fmt.Errorf("both ipblocks should be a single IP range") | |
} | |
return (!b.Overlap(other) && b.Union(other).ipRange.NumIntervals() == 1), nil |
No description provided.