MCPcopy Create free account
hub / github.com/docker/go-plugins-helpers / callURL

Function callURL

network/api_test.go:100–121  ·  view source on GitHub ↗
(url string)

Source from the content-addressed store, hash-verified

98}
99
100func callURL(url string) {
101 c := http.Client{
102 Timeout: 10 * time.Millisecond,
103 }
104 res := make(chan interface{}, 1)
105 go func() {
106 for {
107 _, err := c.Get(url)
108 if err == nil {
109 res <- nil
110 }
111 }
112 }()
113
114 select {
115 case <-res:
116 return
117 case <-time.After(5 * time.Second):
118 fmt.Printf("Timeout connecting to %s\n", url)
119 os.Exit(1)
120 }
121}
122
123func TestMain(m *testing.M) {
124 d := &TestDriver{}

Callers 1

TestMainFunction · 0.70

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…