package main
import (
"fmt"
"math/rand"
"time"
)
func fetchData(server string, ch chan<- string) {
time.Sleep(time.Duration(rand.Intn(10000)) * time.Millisecond)
ch <- fmt.Sprintf("Data from %s", server)
}
func main() {
ch := make(chan string)
go fetchData("Server 1", ch)
go fetchData("Server 2", ch)
go fetchData("Server 3", ch)
go fetchData("Server 4", ch)
first := <-ch
fmt.Printf(first)
}