Skip to content
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

Improve name to make it less confusing #156

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions traverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func IncludeAliasedNetworks(networks *networkOptions) {
networks.includeAliasedNetworks = true
}

// IncludeEmptyNetworks is an option for Networks and NetworksWithin
// IncludeNetworksWithoutData is an option for Networks and NetworksWithin
// that makes them include networks without any data in the iteration.
func IncludeEmptyNetworks(networks *networkOptions) {
func IncludeNetworksWithoutData(networks *networkOptions) {
networks.includeEmptyNetworks = true
}

Expand All @@ -49,7 +49,7 @@ func IncludeEmptyNetworks(networks *networkOptions) {
// [IncludeAliasedNetworks] option.
//
// Networks without data are excluded by default. To include them, use
// [IncludeEmptyNetworks].
// [IncludeNetworksWithoutData].
func (r *Reader) Networks(options ...NetworksOption) iter.Seq[Result] {
if r.Metadata.IPVersion == 6 {
return r.NetworksWithin(allIPv6, options...)
Expand All @@ -69,7 +69,7 @@ func (r *Reader) Networks(options ...NetworksOption) iter.Seq[Result] {
// iterator will iterate over exactly one network, the containing network.
//
// Networks without data are excluded by default. To include them, use
// [IncludeEmptyNetworks].
// [IncludeNetworksWithoutData].
func (r *Reader) NetworksWithin(prefix netip.Prefix, options ...NetworksOption) iter.Seq[Result] {
return func(yield func(Result) bool) {
if r.Metadata.IPVersion == 4 && prefix.Addr().Is6() {
Expand Down
2 changes: 1 addition & 1 deletion traverse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ var tests = []networkTest{
"1.64.0.0/10",
"1.128.0.0/9",
},
Options: []NetworksOption{IncludeEmptyNetworks},
Options: []NetworksOption{IncludeNetworksWithoutData},
},
{
Network: "1.1.1.16/28",
Expand Down
Loading