@@ -32,14 +32,18 @@ type NetworksOption func(*networkOptions)
3232// IncludeAliasedNetworks is an option for Networks and NetworksWithin
3333// that makes them iterate over aliases of the IPv4 subtree in an IPv6
3434// database, e.g., ::ffff:0:0/96, 2001::/32, and 2002::/16.
35- func IncludeAliasedNetworks (networks * networkOptions ) {
36- networks .includeAliasedNetworks = true
35+ func IncludeAliasedNetworks ()NetworksOption {
36+ return func (networks * networkOptions ) {
37+ networks .includeAliasedNetworks = true
38+ }
3739}
3840
3941// IncludeNetworksWithoutData is an option for Networks and NetworksWithin
4042// that makes them include networks without any data in the iteration.
41- func IncludeNetworksWithoutData (networks * networkOptions ) {
42- networks .includeEmptyNetworks = true
43+ func IncludeNetworksWithoutData ()NetworksOption {
44+ return func (networks * networkOptions ) {
45+ networks .includeEmptyNetworks = true
46+ }
4347}
4448
4549// Networks returns an iterator that can be used to traverse the networks in