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

This commit is contained in:
Sandeep Rajan 2019-02-17 03:32:28 -05:00 committed by Miek Gieben
parent 1fe66443a7
commit d42d80c4f6
6 changed files with 11 additions and 11 deletions

View file

@ -185,4 +185,4 @@ func shouldInclude(serv *msg.Service, qType uint16) bool {
return serv.Text != ""
}
return serv.Host != ""
}
}

View 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()

View file

@ -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()

View file

@ -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)

View file

@ -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 {

View file

@ -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{})