From 5bb0d0aaf22e2010e3b259b6ab866ef470e458a4 Mon Sep 17 00:00:00 2001 From: Annika Hannig Date: Thu, 10 Nov 2022 12:07:02 +0100 Subject: [PATCH] simplified using gofmt --- pkg/api/response_test.go | 14 +++++++------- pkg/api/search_filters_test.go | 20 ++++++++++---------- pkg/http/logging_test.go | 2 +- pkg/sources/gobgp/routes.go | 4 ++-- pkg/store/routes_store_test.go | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pkg/api/response_test.go b/pkg/api/response_test.go index 97d1660..6941a50 100644 --- a/pkg/api/response_test.go +++ b/pkg/api/response_test.go @@ -95,17 +95,17 @@ func TestHasCommunity(t *testing.T) { bgp := &BGPInfo{ Communities: []Community{ - Community{42, 123}, - Community{23, 42}, - Community{42, 23}, + {42, 123}, + {23, 42}, + {42, 23}, }, ExtCommunities: []ExtCommunity{ - ExtCommunity{"rt", "23", "42"}, - ExtCommunity{"ro", "123", "456"}, + {"rt", "23", "42"}, + {"ro", "123", "456"}, }, LargeCommunities: []Community{ - Community{1000, 23, 42}, - Community{2000, 123, 456}, + {1000, 23, 42}, + {2000, 123, 456}, }, } diff --git a/pkg/api/search_filters_test.go b/pkg/api/search_filters_test.go index dee0b44..e92262f 100644 --- a/pkg/api/search_filters_test.go +++ b/pkg/api/search_filters_test.go @@ -9,14 +9,14 @@ func makeTestRoute() *Route { route := &Route{ BGP: &BGPInfo{ Communities: []Community{ - Community{23, 42}, - Community{111, 11}, + {23, 42}, + {111, 11}, }, ExtCommunities: []ExtCommunity{ - ExtCommunity{"ro", "23", "123"}, + {"ro", "23", "123"}, }, LargeCommunities: []Community{ - Community{1000, 23, 42}, + {1000, 23, 42}, }, }, } @@ -29,14 +29,14 @@ func makeTestLookupRoute() *LookupRoute { Route: &Route{ BGP: &BGPInfo{ Communities: []Community{ - Community{23, 42}, - Community{111, 11}, + {23, 42}, + {111, 11}, }, ExtCommunities: []ExtCommunity{ - ExtCommunity{"ro", "23", "123"}, + {"ro", "23", "123"}, }, LargeCommunities: []Community{ - Community{1000, 23, 42}, + {1000, 23, 42}, }, }, }, @@ -155,8 +155,8 @@ func TestSearchFilterEqual(t *testing.T) { func TestSearchFilterGroupContains(t *testing.T) { group := SearchFilterGroup{ Filters: []*SearchFilter{ - &SearchFilter{Value: Community{1000, 23, 42}}, - &SearchFilter{Value: Community{1001, 24, 43}}, + {Value: Community{1000, 23, 42}}, + {Value: Community{1001, 24, 43}}, }, } diff --git a/pkg/http/logging_test.go b/pkg/http/logging_test.go index 6d027b4..ae9bf47 100644 --- a/pkg/http/logging_test.go +++ b/pkg/http/logging_test.go @@ -12,7 +12,7 @@ func TestApiLogSourceError(t *testing.T) { cfg := &config.Config{ Sources: []*config.SourceConfig{ - &config.SourceConfig{ + { ID: "rs1v4", Name: "rs1.example.net (IPv4)", }, diff --git a/pkg/sources/gobgp/routes.go b/pkg/sources/gobgp/routes.go index f299bd4..637322b 100644 --- a/pkg/sources/gobgp/routes.go +++ b/pkg/sources/gobgp/routes.go @@ -14,10 +14,10 @@ import ( "github.com/alice-lg/alice-lg/pkg/sources/gobgp/apiutil" ) -var families []gobgpapi.Family = []gobgpapi.Family{gobgpapi.Family{ +var families []gobgpapi.Family = []gobgpapi.Family{{ Afi: gobgpapi.Family_AFI_IP, Safi: gobgpapi.Family_SAFI_UNICAST, -}, gobgpapi.Family{ +}, { Afi: gobgpapi.Family_AFI_IP6, Safi: gobgpapi.Family_SAFI_UNICAST, }, diff --git a/pkg/store/routes_store_test.go b/pkg/store/routes_store_test.go index cd27078..4ab6676 100644 --- a/pkg/store/routes_store_test.go +++ b/pkg/store/routes_store_test.go @@ -21,10 +21,10 @@ func importRoutes( // Prepare imported routes for lookup neighbors := map[string]*api.Neighbor{ - "ID163_AS31078": &api.Neighbor{ + "ID163_AS31078": { ID: "ID163_AS31078", }, - "ID7254_AS31334": &api.Neighbor{ + "ID7254_AS31334": { ID: "ID7254_AS31334", }, }