From 5f38e1148a308615bdcb9945ba6c438574625a3f Mon Sep 17 00:00:00 2001 From: Veselkov Konstantin Date: Sun, 28 Jan 2018 22:53:30 +0400 Subject: [PATCH] fix refactoring --- agent/agent.go | 3 ++- agent/dns.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index c0a1c19126..2069265082 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -607,7 +607,8 @@ func (a *Agent) reloadWatches(cfg *config.RuntimeConfig) error { if raw, ok := args.([]interface{}); hasArgs && ok { var parsed []string for _, arg := range raw { - if v, ok := arg.(string); !ok { + v, ok := arg.(string) + if !ok { return fmt.Errorf("Watch args must be a list of strings") } diff --git a/agent/dns.go b/agent/dns.go index af5e53f73c..c842f07136 100644 --- a/agent/dns.go +++ b/agent/dns.go @@ -110,12 +110,12 @@ func GetDNSConfig(conf *config.RuntimeConfig) *dnsConfig { func (d *DNSServer) ListenAndServe(network, addr string, notif func()) error { mux := dns.NewServeMux() mux.HandleFunc("arpa.", d.handlePtr) - mux.HandleFunc(s.domain, dhandleQuery) + mux.HandleFunc(d.domain, d.handleQuery) if len(d.recursors) > 0 { mux.HandleFunc(".", d.handleRecurse) } - s.Server = &dns.Server{ + d.Server = &dns.Server{ Addr: addr, Net: network, Handler: mux,