Browse code

Move internal/maputil to daemon/libnetwork/internal/maputil

Signed-off-by: Derek McGowan <derek@mcg.dev>

Derek McGowan authored on 2025/07/15 01:25:39
Showing 4 changed files
... ...
@@ -6,7 +6,7 @@ package libnetwork
6 6
 import (
7 7
 	"context"
8 8
 
9
-	"github.com/docker/docker/internal/maputil"
9
+	"github.com/docker/docker/daemon/libnetwork/internal/maputil"
10 10
 )
11 11
 
12 12
 // storeEndpoint inserts or updates the endpoint in the store and the in-memory
13 13
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
1
+//go:build go1.23
2
+
3
+package maputil
4
+
5
+func FilterValues[K comparable, V any](in map[K]V, fn func(V) bool) []V {
6
+	var out []V
7
+	for _, v := range in {
8
+		if fn(v) {
9
+			out = append(out, v)
10
+		}
11
+	}
12
+	return out
13
+}
... ...
@@ -6,7 +6,7 @@ package libnetwork
6 6
 import (
7 7
 	"context"
8 8
 
9
-	"github.com/docker/docker/internal/maputil"
9
+	"github.com/docker/docker/daemon/libnetwork/internal/maputil"
10 10
 )
11 11
 
12 12
 // storeNetwork inserts or updates the network in the store and the in-memory
13 13
deleted file mode 100644
... ...
@@ -1,14 +0,0 @@
1
-// FIXME(thaJeztah): remove once we are a module; the go:build directive prevents go from downgrading language version to go1.16:
2
-//go:build go1.23
3
-
4
-package maputil
5
-
6
-func FilterValues[K comparable, V any](in map[K]V, fn func(V) bool) []V {
7
-	var out []V
8
-	for _, v := range in {
9
-		if fn(v) {
10
-			out = append(out, v)
11
-		}
12
-	}
13
-	return out
14
-}