diff --git a/middleware/backend.go b/middleware/backend.go index 645c859d3..12d1187dc 100644 --- a/middleware/backend.go +++ b/middleware/backend.go @@ -9,7 +9,7 @@ import ( // ServiceBackend defines a (dynamic) backend that returns a slice of service definitions. type ServiceBackend interface { - // Services communicates with the backend to retrieve the service defintion. Exact indicates + // Services communicates with the backend to retrieve the service definition. Exact indicates // on exact much are that we are allowed to recurs. Services(state request.Request, exact bool, opt Options) ([]msg.Service, []msg.Service, error) diff --git a/middleware/cache/cache.go b/middleware/cache/cache.go index 758c298aa..2cd897145 100644 --- a/middleware/cache/cache.go +++ b/middleware/cache/cache.go @@ -130,7 +130,7 @@ const ( defaultCap = 10000 // default capacity of the cache. - // Success is the class for caching postive caching. + // Success is the class for caching positive caching. Success = "success" // Denial is the class defined for negative caching. Denial = "denial" diff --git a/middleware/cache/item.go b/middleware/cache/item.go index 0af3b67ef..37c4f048a 100644 --- a/middleware/cache/item.go +++ b/middleware/cache/item.go @@ -47,7 +47,7 @@ func newItem(m *dns.Msg, d time.Duration) *item { } // toMsg turns i into a message, it tailers the reply to m. -// The Autoritative bit is always set to 0, because the answer is from the cache. +// The Authoritative bit is always set to 0, because the answer is from the cache. func (i *item) toMsg(m *dns.Msg) *dns.Msg { m1 := new(dns.Msg) m1.SetReply(m) diff --git a/middleware/dnssec/black_lies_test.go b/middleware/dnssec/black_lies_test.go index 22ccac91b..55af75302 100644 --- a/middleware/dnssec/black_lies_test.go +++ b/middleware/dnssec/black_lies_test.go @@ -43,7 +43,7 @@ func TestZoneSigningBlackLies(t *testing.T) { func testNxdomainMsg() *dns.Msg { return &dns.Msg{MsgHdr: dns.MsgHdr{Rcode: dns.RcodeNameError}, - Question: []dns.Question{dns.Question{Name: "ww.miek.nl.", Qclass: dns.ClassINET, Qtype: dns.TypeTXT}}, + Question: []dns.Question{{Name: "ww.miek.nl.", Qclass: dns.ClassINET, Qtype: dns.TypeTXT}}, Ns: []dns.RR{test.SOA("miek.nl. 1800 IN SOA linode.atoom.net. miek.miek.nl. 1461471181 14400 3600 604800 14400")}, } } diff --git a/middleware/file/setup.go b/middleware/file/setup.go index b0946ed4b..9dd108ee6 100644 --- a/middleware/file/setup.go +++ b/middleware/file/setup.go @@ -126,7 +126,7 @@ func TransferParse(c *caddy.Controller, secondary bool) (tos, froms []string, er for i := range tos { if tos[i] != "*" { if x := net.ParseIP(tos[i]); x == nil { - return nil, nil, fmt.Errorf("must specify an IP addres: `%s'", tos[i]) + return nil, nil, fmt.Errorf("must specify an IP address: `%s'", tos[i]) } tos[i] = middleware.Addr(tos[i]).Normalize() } @@ -140,7 +140,7 @@ func TransferParse(c *caddy.Controller, secondary bool) (tos, froms []string, er for i := range froms { if froms[i] != "*" { if x := net.ParseIP(froms[i]); x == nil { - return nil, nil, fmt.Errorf("must specify an IP addres: `%s'", froms[i]) + return nil, nil, fmt.Errorf("must specify an IP address: `%s'", froms[i]) } froms[i] = middleware.Addr(froms[i]).Normalize() } else { diff --git a/middleware/file/tree/print.go b/middleware/file/tree/print.go index d95e7e189..bd86ef690 100644 --- a/middleware/file/tree/print.go +++ b/middleware/file/tree/print.go @@ -56,7 +56,7 @@ func (q *queue) pop() *Node { return n } -// empty returns true when the queue containes zero nodes. +// empty returns true when the queue contains zero nodes. func (q *queue) empty() bool { return len(*q) == 0 } diff --git a/middleware/kubernetes/kubernetes.go b/middleware/kubernetes/kubernetes.go index 0a63ffc9e..deab8e453 100644 --- a/middleware/kubernetes/kubernetes.go +++ b/middleware/kubernetes/kubernetes.go @@ -286,7 +286,7 @@ func (k *Kubernetes) getServiceRecordForIP(ip, name string) []msg.Service { } for _, service := range svcList { if service.Spec.ClusterIP == ip { - return []msg.Service{msg.Service{Host: ip}} + return []msg.Service{{Host: ip}} } } diff --git a/middleware/kubernetes/nametemplate/nametemplate_test.go b/middleware/kubernetes/nametemplate/nametemplate_test.go index dcf7a7e68..68c67af12 100644 --- a/middleware/kubernetes/nametemplate/nametemplate_test.go +++ b/middleware/kubernetes/nametemplate/nametemplate_test.go @@ -14,9 +14,9 @@ const ( // Map of format string :: expected locations of name symbols in the format. // -1 value indicates that symbol does not exist in format. var exampleTemplates = map[string][]int{ - "{service}.{namespace}.{type}.{zone}": []int{3, 1, 0}, // service symbol expected @ position 0, namespace @ 1, zone @ 3 - "{namespace}.{type}.{zone}": []int{2, 0, -1}, - "": []int{-1, -1, -1}, + "{service}.{namespace}.{type}.{zone}": {3, 1, 0}, // service symbol expected @ position 0, namespace @ 1, zone @ 3 + "{namespace}.{type}.{zone}": {2, 0, -1}, + "": {-1, -1, -1}, } func TestSetTemplate(t *testing.T) { diff --git a/middleware/metrics/vars/vars.go b/middleware/metrics/vars/vars.go index 2604e2345..7c7576077 100644 --- a/middleware/metrics/vars/vars.go +++ b/middleware/metrics/vars/vars.go @@ -6,7 +6,7 @@ import ( "github.com/prometheus/client_golang/prometheus" ) -// Request* and Reponse* are the prometheus counters and gauges we are using for exporting metrics. +// Request* and Response* are the prometheus counters and gauges we are using for exporting metrics. var ( RequestCount = prometheus.NewCounterVec(prometheus.CounterOpts{ Namespace: middleware.Namespace, diff --git a/middleware/pkg/edns/edns.go b/middleware/pkg/edns/edns.go index d32737840..6cbe2cdae 100644 --- a/middleware/pkg/edns/edns.go +++ b/middleware/pkg/edns/edns.go @@ -1,4 +1,4 @@ -// Package edns provides function usefull for adding/inspecting OPT records to/in messages. +// Package edns provides function useful for adding/inspecting OPT records to/in messages. package edns import ( diff --git a/middleware/pkg/rcode/rcode.go b/middleware/pkg/rcode/rcode.go index e871a96ca..32863f0b2 100644 --- a/middleware/pkg/rcode/rcode.go +++ b/middleware/pkg/rcode/rcode.go @@ -6,7 +6,7 @@ import ( "github.com/miekg/dns" ) -// ToString convert the rcode to the offical DNS string, or to "RCODE"+value if the RCODE +// ToString convert the rcode to the official DNS string, or to "RCODE"+value if the RCODE // value is unknown. func ToString(rcode int) string { if str, ok := dns.RcodeToString[rcode]; ok { diff --git a/middleware/pkg/storage/fs.go b/middleware/pkg/storage/fs.go index a6ea181f1..bb9719c86 100644 --- a/middleware/pkg/storage/fs.go +++ b/middleware/pkg/storage/fs.go @@ -24,7 +24,7 @@ type dir http.Dir // Dexample.org/... // Db.example.org/... // -// CoreDir will default to "$HOME/.coredns" on Unix, but it's location can be overriden with the COREDNSPATH +// CoreDir will default to "$HOME/.coredns" on Unix, but it's location can be overridden with the COREDNSPATH // environment variable. var CoreDir = dir(fsPath()) diff --git a/test/auto_test.go b/test/auto_test.go index c9abf826a..c44a2a8c3 100644 --- a/test/auto_test.go +++ b/test/auto_test.go @@ -35,7 +35,7 @@ func TestAuto(t *testing.T) { udp, _ := CoreDNSServerPorts(i, 0) if udp == "" { - t.Fatalf("Could not get UDP listening port") + t.Fatal("Could not get UDP listening port") } defer i.Stop() @@ -102,7 +102,7 @@ func TestAutoNonExistentZone(t *testing.T) { udp, _ := CoreDNSServerPorts(i, 0) if udp == "" { - t.Fatalf("Could not get UDP listening port") + t.Fatal("Could not get UDP listening port") } defer i.Stop() @@ -141,7 +141,7 @@ func TestAutoAXFR(t *testing.T) { udp, _ := CoreDNSServerPorts(i, 0) if udp == "" { - t.Fatalf("Could not get UDP listening port") + t.Fatal("Could not get UDP listening port") } defer i.Stop() @@ -162,7 +162,7 @@ func TestAutoAXFR(t *testing.T) { t.Fatal("Expected to receive reply, but didn't") } if len(resp.Answer) != 5 { - t.Fatal("Expected response with %d RRs, got %d", 5, len(resp.Answer)) + t.Fatalf("Expected response with %d RRs, got %d", 5, len(resp.Answer)) } }