refactor: move a func that is only used in testing

This commit is contained in:
Matthias Radestock committed 2015-03-26 13:53:09 +00:00
1 parent b83f4c9ee9
commit e7335f361c
2 files changed
+4 -5

No files matched your search

-5
View File
@@ -105,11 +105,6 @@ func LinkLocalMulticastListener(ifi *net.Interface) (net.PacketConn, error) {
type MDNSAction func()
// Async
func (c *MDNSClient) Shutdown() {
c.actionChan <- nil
}
// Async
func (c *MDNSClient) SendQuery(name string, querytype uint16, responseCh chan<- *Response) {
c.actionChan <- func() {
+4
View File
@@ -85,6 +85,10 @@ func setup(t *testing.T) (*MDNSClient, *dns.Server, error) {
return mdnsClient, server, err
}
func (c *MDNSClient) Shutdown() {
c.actionChan <- nil
}
type testContext struct {
receivedAddr net.IP
receivedCount int