Skip to content

Commit

Permalink
Consistant decleration of a silce of Ambassador Hosts
Browse files Browse the repository at this point in the history
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 kubernetes-sigs#2633 (comment)
  • Loading branch information
KyleMartin901 committed Jun 7, 2022
1 parent 51e3633 commit 2482ef5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/ambassador_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion source/ambassador_host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 2482ef5

Please sign in to comment.