Run gofmt -w -s on codebase (#2773)

This formats and simplifies all code by running gofmt -w -s on all Go
files.

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2019-04-08 11:13:46 +01:00
committed by GitHub
parent e3f9a80b1d
commit 58c703f5ef
8 changed files with 71 additions and 71 deletions

View File

@@ -53,7 +53,7 @@ type dnsControl struct {
client kubernetes.Interface
selector labels.Selector
selector labels.Selector
namespaceSelector labels.Selector
svcController cache.Controller
@@ -84,10 +84,10 @@ type dnsControlOpts struct {
ignoreEmptyService bool
// Label handling.
labelSelector *meta.LabelSelector
selector labels.Selector
labelSelector *meta.LabelSelector
selector labels.Selector
namespaceLabelSelector *meta.LabelSelector
namespaceSelector labels.Selector
namespaceSelector labels.Selector
zones []string
endpointNameMode bool
@@ -96,12 +96,12 @@ type dnsControlOpts struct {
// newDNSController creates a controller for CoreDNS.
func newdnsController(kubeClient kubernetes.Interface, opts dnsControlOpts) *dnsControl {
dns := dnsControl{
client: kubeClient,
selector: opts.selector,
client: kubeClient,
selector: opts.selector,
namespaceSelector: opts.namespaceSelector,
stopCh: make(chan struct{}),
zones: opts.zones,
endpointNameMode: opts.endpointNameMode,
stopCh: make(chan struct{}),
zones: opts.zones,
endpointNameMode: opts.endpointNameMode,
}
dns.svcLister, dns.svcController = object.NewIndexerInformer(

View File

@@ -5,13 +5,13 @@ import (
)
func TestFilteredNamespaceExists(t *testing.T) {
tests := []struct{
tests := []struct {
expected bool
kubernetesNamespaces map[string]struct{}
testNamespace string
}{
{true, map[string]struct{}{}, "foobar" },
{false, map[string]struct{}{}, "nsnoexist" },
{true, map[string]struct{}{}, "foobar"},
{false, map[string]struct{}{}, "nsnoexist"},
}
k := Kubernetes{}
@@ -26,15 +26,15 @@ func TestFilteredNamespaceExists(t *testing.T) {
}
func TestNamespaceExposed(t *testing.T) {
tests := []struct{
tests := []struct {
expected bool
kubernetesNamespaces map[string]struct{}
testNamespace string
}{
{true, map[string]struct{}{ "foobar": {} }, "foobar" },
{false, map[string]struct{}{ "foobar": {} }, "nsnoexist" },
{true, map[string]struct{}{}, "foobar" },
{true, map[string]struct{}{}, "nsnoexist" },
{true, map[string]struct{}{"foobar": {}}, "foobar"},
{false, map[string]struct{}{"foobar": {}}, "nsnoexist"},
{true, map[string]struct{}{}, "foobar"},
{true, map[string]struct{}{}, "nsnoexist"},
}
k := Kubernetes{}
@@ -49,15 +49,15 @@ func TestNamespaceExposed(t *testing.T) {
}
func TestNamespaceValid(t *testing.T) {
tests := []struct{
tests := []struct {
expected bool
kubernetesNamespaces map[string]struct{}
testNamespace string
}{
{true, map[string]struct{}{ "foobar": {} }, "foobar" },
{false, map[string]struct{}{ "foobar": {} }, "nsnoexist" },
{true, map[string]struct{}{}, "foobar" },
{false, map[string]struct{}{}, "nsnoexist" },
{true, map[string]struct{}{"foobar": {}}, "foobar"},
{false, map[string]struct{}{"foobar": {}}, "nsnoexist"},
{true, map[string]struct{}{}, "foobar"},
{false, map[string]struct{}{}, "nsnoexist"},
}
k := Kubernetes{}