From f494426f7398259fe76a1149e5c94a90ec3ced42 Mon Sep 17 00:00:00 2001 From: ZouYu Date: Thu, 9 Apr 2020 18:29:19 +0800 Subject: [PATCH] fix warning redundant type from array, slice, or map composite literal (#7106) Signed-off-by: ZouYu --- discovery/manager_test.go | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/discovery/manager_test.go b/discovery/manager_test.go index 72adfbaca..4cdcc6370 100644 --- a/discovery/manager_test.go +++ b/discovery/manager_test.go @@ -758,20 +758,20 @@ func TestTargetSetRecreatesTargetGroupsEveryRun(t *testing.T) { go discoveryManager.Run() c := map[string]sd_config.ServiceDiscoveryConfig{ - "prometheus": sd_config.ServiceDiscoveryConfig{ + "prometheus": { StaticConfigs: []*targetgroup.Group{ - &targetgroup.Group{ + { Source: "0", Targets: []model.LabelSet{ - model.LabelSet{ + { model.AddressLabel: model.LabelValue("foo:9090"), }, }, }, - &targetgroup.Group{ + { Source: "1", Targets: []model.LabelSet{ - model.LabelSet{ + { model.AddressLabel: model.LabelValue("bar:9090"), }, }, @@ -787,10 +787,10 @@ func TestTargetSetRecreatesTargetGroupsEveryRun(t *testing.T) { c["prometheus"] = sd_config.ServiceDiscoveryConfig{ StaticConfigs: []*targetgroup.Group{ - &targetgroup.Group{ + { Source: "0", Targets: []model.LabelSet{ - model.LabelSet{ + { model.AddressLabel: model.LabelValue("foo:9090"), }, }, @@ -815,12 +815,12 @@ func TestTargetSetRecreatesEmptyStaticConfigs(t *testing.T) { go discoveryManager.Run() c := map[string]sd_config.ServiceDiscoveryConfig{ - "prometheus": sd_config.ServiceDiscoveryConfig{ + "prometheus": { StaticConfigs: []*targetgroup.Group{ - &targetgroup.Group{ + { Source: "0", Targets: []model.LabelSet{ - model.LabelSet{ + { model.AddressLabel: model.LabelValue("foo:9090"), }, }, @@ -880,9 +880,9 @@ func TestIdenticalConfigurationsAreCoalesced(t *testing.T) { go discoveryManager.Run() c := map[string]sd_config.ServiceDiscoveryConfig{ - "prometheus": sd_config.ServiceDiscoveryConfig{ + "prometheus": { FileSDConfigs: []*file.SDConfig{ - &file.SDConfig{ + { Files: []string{ tmpFile2, }, @@ -890,9 +890,9 @@ func TestIdenticalConfigurationsAreCoalesced(t *testing.T) { }, }, }, - "prometheus2": sd_config.ServiceDiscoveryConfig{ + "prometheus2": { FileSDConfigs: []*file.SDConfig{ - &file.SDConfig{ + { Files: []string{ tmpFile2, }, @@ -958,21 +958,21 @@ func TestGaugeFailedConfigs(t *testing.T) { go discoveryManager.Run() c := map[string]sd_config.ServiceDiscoveryConfig{ - "prometheus": sd_config.ServiceDiscoveryConfig{ + "prometheus": { ConsulSDConfigs: []*consul.SDConfig{ - &consul.SDConfig{ + { Server: "foo:8500", TLSConfig: common_config.TLSConfig{ CertFile: "/tmp/non_existent", }, }, - &consul.SDConfig{ + { Server: "bar:8500", TLSConfig: common_config.TLSConfig{ CertFile: "/tmp/non_existent", }, }, - &consul.SDConfig{ + { Server: "foo2:8500", TLSConfig: common_config.TLSConfig{ CertFile: "/tmp/non_existent", @@ -991,10 +991,10 @@ func TestGaugeFailedConfigs(t *testing.T) { c["prometheus"] = sd_config.ServiceDiscoveryConfig{ StaticConfigs: []*targetgroup.Group{ - &targetgroup.Group{ + { Source: "0", Targets: []model.LabelSet{ - model.LabelSet{ + { model.AddressLabel: "foo:9090", }, },