Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit f6f58f3

Browse files
committed
daemon.getEndpointInNetwork() is only used on Windows
``` 13:06:14 daemon/network.go:964:6: U1000: func `getEndpointInNetwork` is unused (unused) 13:06:14 func getEndpointInNetwork(name string, n libnetwork.Network) (libnetwork.Endpoint, error) { ``` Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent e334eee commit f6f58f3

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

daemon/network.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -960,12 +960,6 @@ func buildCreateEndpointOptions(c *container.Container, n libnetwork.Network, ep
960960
return createOptions, nil
961961
}
962962

963-
// getEndpointInNetwork returns the container's endpoint to the provided network.
964-
func getEndpointInNetwork(name string, n libnetwork.Network) (libnetwork.Endpoint, error) {
965-
endpointName := strings.TrimPrefix(name, "/")
966-
return n.EndpointByName(endpointName)
967-
}
968-
969963
// getSandboxPortMapInfo retrieves the current port-mapping programmed for the given sandbox
970964
func getSandboxPortMapInfo(sb libnetwork.Sandbox) nat.PortMap {
971965
pm := nat.PortMap{}

daemon/network_windows.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package daemon
2+
3+
import (
4+
"strings"
5+
6+
"github.com/docker/libnetwork"
7+
)
8+
9+
// getEndpointInNetwork returns the container's endpoint to the provided network.
10+
func getEndpointInNetwork(name string, n libnetwork.Network) (libnetwork.Endpoint, error) {
11+
endpointName := strings.TrimPrefix(name, "/")
12+
return n.EndpointByName(endpointName)
13+
}

0 commit comments

Comments
 (0)