code: func (w *ResponseWriter) WriteMsg(resp *dns.Msg) (writeErr error) {
  	writeErr = w.ResponseWriter.WriteMsg(resp)
  	writeEpoch := uint64(time.Now().Unix())
  
  	b := w.TapBuilder()
  	b.TimeSec = w.queryEpoch
  
  	if w.Send == nil || w.Send.Cq {
  		if err := func() (err error) {
  			err = b.AddrMsg(w.ResponseWriter.RemoteAddr(), w.Query)
  			if err != nil {
  				return
  			}
  			return w.TapMessage(b.ToClientQuery())
  		}(); err != nil {
  			w.err = fmt.Errorf("client query: %s", err)
  			// don't forget to call DnstapError later
  		}
  	}
  
  	if w.Send == nil || w.Send.Cr {
  		if writeErr == nil {
  			if err := func() (err error) {
  				b.TimeSec = writeEpoch
  				if err = b.Msg(resp); err != nil {
  					return
  				}
  				return w.TapMessage(b.ToClientResponse())
  			}(); err != nil {
  				w.err = fmt.Errorf("client response: %s", err)
  			}
  		}
  	}
  	return
  }
docs: // WriteMsg writes back the response to the client and THEN works on logging the request
  // and response to dnstap.
  // Dnstap errors are to be checked by DnstapError.