func waitFor(once *sync.Once, client dockerclient.Client, endpoint string) { once.Do(func() { err := ClientOK(endpoint, func() bool { _, err := client.Info() return err == nil }) if err != nil { panic(err.Error()) } }) }