Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5f75200

Browse files
committed
Make functional option functions return a function
1 parent08e1e50 commit5f75200

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#Changes
22

3+
##2.0.0-beta.4
4+
5+
-`IncludeNetworksWithoutData` and`IncludeAliasedNetworks` now return a
6+
`NetworksOption` rather than being one themselves. This was done to improve
7+
the documentation organization.
8+
39
##2.0.0-beta.3 - 2025-02-16
410

511
-`Open` will now fall back to loading the database in memory if the

‎traverse.go‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
funcIncludeAliasedNetworks(networks*networkOptions) {
36-
networks.includeAliasedNetworks=true
35+
funcIncludeAliasedNetworks()NetworksOption {
36+
returnfunc(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-
funcIncludeNetworksWithoutData(networks*networkOptions) {
42-
networks.includeEmptyNetworks=true
43+
funcIncludeNetworksWithoutData()NetworksOption {
44+
returnfunc(networks*networkOptions) {
45+
networks.includeEmptyNetworks=true
46+
}
4347
}
4448

4549
// Networks returns an iterator that can be used to traverse the networks in

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp