in my case, i have serval child routine for query for dns record, but i 
just need a answer

code looks like:

    recvChan := make(chan *dnsRecord, 1)


    defer close(recvChan)




    for _, server := range DnsServers {


        go doResolve(server, req, recvChan)   // query ip address


    }




    select {


    case r := <-recvChan:   // receive address


        responseRecord(w, req, r)  // response to client


    case <-time.After(2 * time.Second):  // timeout


        break


    }
     
    return


do i need to wait all child routine exit before return

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to