fix warning redundant type from array, slice, or map composite literal (#7106)

Signed-off-by: ZouYu <zouy.fnst@cn.fujitsu.com>
superq/test
ZouYu 5 years ago committed by GitHub
parent 94f577580d
commit f494426f73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -758,20 +758,20 @@ func TestTargetSetRecreatesTargetGroupsEveryRun(t *testing.T) {
go discoveryManager.Run() go discoveryManager.Run()
c := map[string]sd_config.ServiceDiscoveryConfig{ c := map[string]sd_config.ServiceDiscoveryConfig{
"prometheus": sd_config.ServiceDiscoveryConfig{ "prometheus": {
StaticConfigs: []*targetgroup.Group{ StaticConfigs: []*targetgroup.Group{
&targetgroup.Group{ {
Source: "0", Source: "0",
Targets: []model.LabelSet{ Targets: []model.LabelSet{
model.LabelSet{ {
model.AddressLabel: model.LabelValue("foo:9090"), model.AddressLabel: model.LabelValue("foo:9090"),
}, },
}, },
}, },
&targetgroup.Group{ {
Source: "1", Source: "1",
Targets: []model.LabelSet{ Targets: []model.LabelSet{
model.LabelSet{ {
model.AddressLabel: model.LabelValue("bar:9090"), model.AddressLabel: model.LabelValue("bar:9090"),
}, },
}, },
@ -787,10 +787,10 @@ func TestTargetSetRecreatesTargetGroupsEveryRun(t *testing.T) {
c["prometheus"] = sd_config.ServiceDiscoveryConfig{ c["prometheus"] = sd_config.ServiceDiscoveryConfig{
StaticConfigs: []*targetgroup.Group{ StaticConfigs: []*targetgroup.Group{
&targetgroup.Group{ {
Source: "0", Source: "0",
Targets: []model.LabelSet{ Targets: []model.LabelSet{
model.LabelSet{ {
model.AddressLabel: model.LabelValue("foo:9090"), model.AddressLabel: model.LabelValue("foo:9090"),
}, },
}, },
@ -815,12 +815,12 @@ func TestTargetSetRecreatesEmptyStaticConfigs(t *testing.T) {
go discoveryManager.Run() go discoveryManager.Run()
c := map[string]sd_config.ServiceDiscoveryConfig{ c := map[string]sd_config.ServiceDiscoveryConfig{
"prometheus": sd_config.ServiceDiscoveryConfig{ "prometheus": {
StaticConfigs: []*targetgroup.Group{ StaticConfigs: []*targetgroup.Group{
&targetgroup.Group{ {
Source: "0", Source: "0",
Targets: []model.LabelSet{ Targets: []model.LabelSet{
model.LabelSet{ {
model.AddressLabel: model.LabelValue("foo:9090"), model.AddressLabel: model.LabelValue("foo:9090"),
}, },
}, },
@ -880,9 +880,9 @@ func TestIdenticalConfigurationsAreCoalesced(t *testing.T) {
go discoveryManager.Run() go discoveryManager.Run()
c := map[string]sd_config.ServiceDiscoveryConfig{ c := map[string]sd_config.ServiceDiscoveryConfig{
"prometheus": sd_config.ServiceDiscoveryConfig{ "prometheus": {
FileSDConfigs: []*file.SDConfig{ FileSDConfigs: []*file.SDConfig{
&file.SDConfig{ {
Files: []string{ Files: []string{
tmpFile2, tmpFile2,
}, },
@ -890,9 +890,9 @@ func TestIdenticalConfigurationsAreCoalesced(t *testing.T) {
}, },
}, },
}, },
"prometheus2": sd_config.ServiceDiscoveryConfig{ "prometheus2": {
FileSDConfigs: []*file.SDConfig{ FileSDConfigs: []*file.SDConfig{
&file.SDConfig{ {
Files: []string{ Files: []string{
tmpFile2, tmpFile2,
}, },
@ -958,21 +958,21 @@ func TestGaugeFailedConfigs(t *testing.T) {
go discoveryManager.Run() go discoveryManager.Run()
c := map[string]sd_config.ServiceDiscoveryConfig{ c := map[string]sd_config.ServiceDiscoveryConfig{
"prometheus": sd_config.ServiceDiscoveryConfig{ "prometheus": {
ConsulSDConfigs: []*consul.SDConfig{ ConsulSDConfigs: []*consul.SDConfig{
&consul.SDConfig{ {
Server: "foo:8500", Server: "foo:8500",
TLSConfig: common_config.TLSConfig{ TLSConfig: common_config.TLSConfig{
CertFile: "/tmp/non_existent", CertFile: "/tmp/non_existent",
}, },
}, },
&consul.SDConfig{ {
Server: "bar:8500", Server: "bar:8500",
TLSConfig: common_config.TLSConfig{ TLSConfig: common_config.TLSConfig{
CertFile: "/tmp/non_existent", CertFile: "/tmp/non_existent",
}, },
}, },
&consul.SDConfig{ {
Server: "foo2:8500", Server: "foo2:8500",
TLSConfig: common_config.TLSConfig{ TLSConfig: common_config.TLSConfig{
CertFile: "/tmp/non_existent", CertFile: "/tmp/non_existent",
@ -991,10 +991,10 @@ func TestGaugeFailedConfigs(t *testing.T) {
c["prometheus"] = sd_config.ServiceDiscoveryConfig{ c["prometheus"] = sd_config.ServiceDiscoveryConfig{
StaticConfigs: []*targetgroup.Group{ StaticConfigs: []*targetgroup.Group{
&targetgroup.Group{ {
Source: "0", Source: "0",
Targets: []model.LabelSet{ Targets: []model.LabelSet{
model.LabelSet{ {
model.AddressLabel: "foo:9090", model.AddressLabel: "foo:9090",
}, },
}, },

Loading…
Cancel
Save