diff --git a/client.go b/client.go index 68a8487a..a01ea618 100644 --- a/client.go +++ b/client.go @@ -63,10 +63,12 @@ func newQueryChan() chan *Request { return make(chan *Request) } // Default channels to use for the resolver var ( - DefaultReplyChan = newQueryChanSlice() // DefaultReplyChan is the channel on which the replies are + // DefaultReplyChan is the channel on which the replies are // coming back. Is it a channel of *Exchange, so that the original // question is included with the answer. - DefaultQueryChan = newQueryChan() // DefaultQueryChan is the channel were you can send the questions to. + DefaultReplyChan = newQueryChanSlice() + // DefaultQueryChan is the channel were you can send the questions to. + DefaultQueryChan = newQueryChan() ) // The HandlerQueryFunc type is an adapter to allow the use of diff --git a/dns.go b/dns.go index ee6c1260..93eb6d81 100644 --- a/dns.go +++ b/dns.go @@ -27,10 +27,10 @@ // m := new(Msg) // m.SetQuestion("miek.nl.", TypeMX) // -// The message m is now a messages with the Question section set to ask +// The message m is now a message with the question section set to ask // the MX records for the miek.nl. zone. // -// This is slightly more verbose, but more flexible: +// The following is slightly more verbose, but more flexible: // // m1 := new(Msg) // m1.MsgHdr.Id = Id() @@ -47,7 +47,7 @@ // // c.Net = "tcp" // If you want to use TCP // in := c.Exchange(m, "127.0.0.1:53") // -// An asynchronous query ... TODO(mg) +// An asynchronous query is also possible. The Basic use pattern is: TODO(mg) package dns import ( diff --git a/msg.go b/msg.go index a2c06276..246406ea 100644 --- a/msg.go +++ b/msg.go @@ -1079,8 +1079,8 @@ func (dns *Msg) String() string { return s } -// Return a 16 bits random number to be used as a +// Id return a 16 bits random number to be used as a // message id. The random provided should be good enough. func Id() uint16 { - return uint16(rand.Int()) ^ uint16(time.Now().UnixNano()) + return uint16(rand.Int()) ^ uint16(time.Now().Nanosecond()) }