From 2482ef5653c24ab29139247fc9a885805f264962 Mon Sep 17 00:00:00 2001 From: Kyle Martin Date: Tue, 7 Jun 2022 10:32:47 +1000 Subject: [PATCH] Consistant decleration of a silce of Ambassador Hosts Correcting the inconsistancy in the way an empty slice of Ambassador Hosts were declared so it is clean and clearer. Thanks to alebedev87 for catching this in https://github.com/kubernetes-sigs/external-dns/pull/2633#discussion_r886851525 --- source/ambassador_host.go | 2 +- source/ambassador_host_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ambassador_host.go b/source/ambassador_host.go index 907e589edb..eb3c7df0ee 100644 --- a/source/ambassador_host.go +++ b/source/ambassador_host.go @@ -119,7 +119,7 @@ func (sc *ambassadorHostSource) Endpoints(ctx context.Context) ([]*endpoint.Endp } // Get a list of Ambassador Host resources - var ambassadorHosts []*ambassador.Host + ambassadorHosts := []*ambassador.Host{} for _, hostObj := range hosts { unstructuredHost, ok := hostObj.(*unstructured.Unstructured) if !ok { diff --git a/source/ambassador_host_test.go b/source/ambassador_host_test.go index 9f1fb52b57..9d5a271d56 100644 --- a/source/ambassador_host_test.go +++ b/source/ambassador_host_test.go @@ -569,7 +569,7 @@ func testAmbassadorSourceEndpoints(t *testing.T) { ti := ti t.Run(ti.title, func(t *testing.T) { // Create a slice of Ambassador Hosts - ambassadorHosts := make([]*ambassador.Host, 0) + ambassadorHosts := []*ambassador.Host{} // Convert our test data into Ambassador Hosts for _, host := range ti.ambassadorHostItems {