func HandleRxMsg(h RxRRHandler) RxMsgHandler {
	n := 0
	return func(serial int, m *msg.Message) bool {
		var r *rr.RR
		for _, r = range m.Answer {
			if n == 0 && r.Type != rr.TYPE_SOA {
				panic(fmt.Errorf("invalid first RR Type %s\n", r.Type))
			}

			if !h(n, r) {
				return false
			}

			n++
		}
		return n == 0 || r.Type != rr.TYPE_SOA
	}
}
// HandleMsg returns a pre-built MsgHandler for RxAll which invokes the provided RRHandler
// for every DNS RR found in the answer section of 'm'. Usage example:
//	err := xfr.RxAll(myConn, myZone, HandleMsg(myRRHandler), myErrHandler)
// The record handler 'h' sees the first SOA record, and all subsequent RRs including the final,
// "closing" SOA RR.
HandleMsg returns a pre-built MsgHandler for RxAll which invokes the provided RRHandler
for every DNS RR found in the answer section of 'm'. Usage example:
err := xfr.RxAll(myConn, myZone, HandleMsg(myRRHandler), myErrHandler)
The record handler 'h' sees the first SOA record, and all subsequent RRs including the final,
"closing" SOA RR.
// HandleMsg returns a pre - built MsgHandler for RxAll which invokes the provided RRHandler // for every DNS RR found in the answer section of ' m ' . Usage example : // err : = xfr . RxAll ( myConn myZone HandleMsg ( myRRHandler ) myErrHandler ) // The record handler ' h ' sees the first SOA record and all subsequent RRs including the final // " closing " SOA RR .
func HandleRxMsg(h RxRRHandler) RxMsgHandler {
	n := 0
	return func(serial int, m *msg.Message) bool {
		var r *rr.RR
		for _, r = range m.Answer {
			if n == 0 && r.Type != rr.TYPE_SOA {
				panic(fmt.Errorf("invalid first RR Type %s\n", r.Type))
			}
			if !h(n, r) {
				return false
			}
			n++
		}
		return n == 0 || r.Type != rr.TYPE_SOA
	}
}
func HandleRxMsg ( h RxRRHandler ) RxMsgHandler { n := 0 return func ( serial int , m * msg . Message ) bool { var r * rr . RR for _ , r = range m . Answer { if n == 0 && r . Type != rr . TYPE_SOA { panic ( fmt . Errorf ( " \n " , r . Type ) ) } if ! h ( n , r ) { return false } n ++ } return n == 0 || r . Type != rr . TYPE_SOA } }
HandleMsg returns a pre-built MsgHandler for RxAll which invokes the provided RRHandler
for every DNS RR found in the answer section of 'm'.
HandleMsg returns a pre - built MsgHandler for RxAll which invokes the provided RRHandler for every DNS RR found in the answer section of ' m ' .