Skip to content

Commit 0ca2750

Browse files
committed
Improve name to make it less confusing
1 parent 8f32dec commit 0ca2750

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

traverse.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ func IncludeAliasedNetworks(networks *networkOptions) {
3434
networks.includeAliasedNetworks = true
3535
}
3636

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

@@ -49,7 +49,7 @@ func IncludeEmptyNetworks(networks *networkOptions) {
4949
// [IncludeAliasedNetworks] option.
5050
//
5151
// Networks without data are excluded by default. To include them, use
52-
// [IncludeEmptyNetworks].
52+
// [IncludeNetworksWithoutData].
5353
func (r *Reader) Networks(options ...NetworksOption) iter.Seq[Result] {
5454
if r.Metadata.IPVersion == 6 {
5555
return r.NetworksWithin(allIPv6, options...)
@@ -69,7 +69,7 @@ func (r *Reader) Networks(options ...NetworksOption) iter.Seq[Result] {
6969
// iterator will iterate over exactly one network, the containing network.
7070
//
7171
// Networks without data are excluded by default. To include them, use
72-
// [IncludeEmptyNetworks].
72+
// [IncludeNetworksWithoutData].
7373
func (r *Reader) NetworksWithin(prefix netip.Prefix, options ...NetworksOption) iter.Seq[Result] {
7474
return func(yield func(Result) bool) {
7575
if r.Metadata.IPVersion == 4 && prefix.Addr().Is6() {

traverse_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ var tests = []networkTest{
281281
"1.64.0.0/10",
282282
"1.128.0.0/9",
283283
},
284-
Options: []NetworksOption{IncludeEmptyNetworks},
284+
Options: []NetworksOption{IncludeNetworksWithoutData},
285285
},
286286
{
287287
Network: "1.1.1.16/28",

0 commit comments

Comments
 (0)