Goroutine Timeout
问题 type Response struct { data interface{} status bool } func Find() (interface{}, bool) { ch := make(chan Response, 1) go func() { data, status := findCicCode() ch <- Response{data: data, status: status} }() select { case response := <-ch: return response.data, response.status case <-time.After(50 * time.Millisecond): return "Request timed out", false } } So, I have above function. Basically findCicCode() function call makes 3 http calls internally to external services. I have added combined