MCPcopy
hub / github.com/basecamp/once / getFreePort

Function getFreePort

integration/docker_test.go:900–906  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

898}
899
900func getFreePort(t *testing.T) int {
901 t.Helper()
902 listener, err := net.Listen("tcp", "127.0.0.1:0")
903 require.NoError(t, err)
904 defer listener.Close()
905 return listener.Addr().(*net.TCPAddr).Port
906}
907
908func getProxyPorts(t *testing.T) docker.ProxySettings {
909 t.Helper()

Callers 2

getProxyPortsFunction · 0.85
startLocalRegistryFunction · 0.85

Calls 1

CloseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…