Commit d42d80c4 authored by Sandeep Rajan's avatar Sandeep Rajan Committed by Miek Gieben

cleanup by fmt and remove redundant type declarations (#2563)

parent 1fe66443
......@@ -185,4 +185,4 @@ func shouldInclude(serv *msg.Service, qType uint16) bool {
return serv.Text != ""
}
return serv.Host != ""
}
\ No newline at end of file
}
......@@ -13,7 +13,7 @@ import (
func TestApex(t *testing.T) {
k := kubernetes.New([]string{"cluster.local."})
k.Namespaces = map[string]struct{}{"testns": struct{}{}}
k.Namespaces = map[string]struct{}{"testns": {}}
k.APIConn = &external{}
e := New()
......
......@@ -17,7 +17,7 @@ import (
func TestExternal(t *testing.T) {
k := kubernetes.New([]string{"cluster.local."})
k.Namespaces = map[string]struct{}{"testns": struct{}{}}
k.Namespaces = map[string]struct{}{"testns": {}}
k.APIConn = &external{}
e := New()
......
......@@ -22,13 +22,13 @@ var extCases = []struct {
{
Qname: "svc1.testns.example.org.", Rcode: dns.RcodeSuccess,
Msg: []msg.Service{
msg.Service{Host: "1.2.3.4", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
{Host: "1.2.3.4", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
},
},
{
Qname: "svc6.testns.example.org.", Rcode: dns.RcodeSuccess,
Msg: []msg.Service{
msg.Service{Host: "1:2::5", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
{Host: "1:2::5", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
},
},
{
......@@ -37,7 +37,7 @@ var extCases = []struct {
{
Qname: "_http._tcp.svc1.testns.example.com.", Rcode: dns.RcodeSuccess,
Msg: []msg.Service{
msg.Service{Host: "1.2.3.4", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
{Host: "1.2.3.4", Port: 80, TTL: 5, Key: "/c/org/example/testns/svc1"},
},
},
{
......@@ -52,7 +52,7 @@ func TestExternal(t *testing.T) {
k := New([]string{"cluster.local."})
k.APIConn = &external{}
k.Next = test.NextHandler(dns.RcodeSuccess, nil)
k.Namespaces = map[string]struct{}{"testns": struct{}{}}
k.Namespaces = map[string]struct{}{"testns": {}}
for i, tc := range extCases {
state := testRequest(tc.Qname)
......
......@@ -347,7 +347,7 @@ func TestServeDNS(t *testing.T) {
k := New([]string{"cluster.local."})
k.APIConn = &APIConnServeTest{}
k.Next = test.NextHandler(dns.RcodeSuccess, nil)
k.Namespaces = map[string]struct{}{"testns": struct{}{}}
k.Namespaces = map[string]struct{}{"testns": {}}
ctx := context.TODO()
for i, tc := range dnsTestCases {
......@@ -398,7 +398,7 @@ func TestNotSyncedServeDNS(t *testing.T) {
notSynced: true,
}
k.Next = test.NextHandler(dns.RcodeSuccess, nil)
k.Namespaces = map[string]struct{}{"testns": struct{}{}}
k.Namespaces = map[string]struct{}{"testns": {}}
ctx := context.TODO()
for i, tc := range notSyncedTestCases {
......
......@@ -15,7 +15,7 @@ func TestKubernetesXFR(t *testing.T) {
k := New([]string{"cluster.local."})
k.APIConn = &APIConnServeTest{}
k.TransferTo = []string{"10.240.0.1:53"}
k.Namespaces = map[string]struct{}{"testns": struct{}{}}
k.Namespaces = map[string]struct{}{"testns": {}}
ctx := context.TODO()
w := dnstest.NewMultiRecorder(&test.ResponseWriter{})
......@@ -103,7 +103,7 @@ func TestKubernetesXFRNotAllowed(t *testing.T) {
k := New([]string{"cluster.local."})
k.APIConn = &APIConnServeTest{}
k.TransferTo = []string{"1.2.3.4:53"}
k.Namespaces = map[string]struct{}{"testns": struct{}{}}
k.Namespaces = map[string]struct{}{"testns": {}}
ctx := context.TODO()
w := dnstest.NewMultiRecorder(&test.ResponseWriter{})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment