From 100c5d45da15348b60eab6b05998fe58ef035aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Thu, 12 Dec 2024 13:09:54 +0100 Subject: [PATCH] [exporter/elasticsearch][chore]: Fix copyloopvar issues --- exporter/elasticsearchexporter/bulkindexer_test.go | 4 ---- exporter/elasticsearchexporter/config_test.go | 1 - exporter/elasticsearchexporter/exporter_test.go | 2 -- exporter/elasticsearchexporter/mapping_hint_test.go | 1 - 4 files changed, 8 deletions(-) diff --git a/exporter/elasticsearchexporter/bulkindexer_test.go b/exporter/elasticsearchexporter/bulkindexer_test.go index e09a26f121b7..2b3d86a30128 100644 --- a/exporter/elasticsearchexporter/bulkindexer_test.go +++ b/exporter/elasticsearchexporter/bulkindexer_test.go @@ -85,7 +85,6 @@ func TestAsyncBulkIndexer_flush(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() client, err := elasticsearch.NewClient(elasticsearch.Config{Transport: &mockTransport{ @@ -139,7 +138,6 @@ func TestAsyncBulkIndexer_requireDataStream(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() requireDataStreamCh := make(chan bool, 1) @@ -215,7 +213,6 @@ func TestAsyncBulkIndexer_flush_error(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() cfg := Config{NumWorkers: 1, Flush: FlushSettings{Interval: time.Hour, Bytes: 1}} @@ -269,7 +266,6 @@ func TestAsyncBulkIndexer_logRoundTrip(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() diff --git a/exporter/elasticsearchexporter/config_test.go b/exporter/elasticsearchexporter/config_test.go index f3f848db2c90..b83beb3e91ba 100644 --- a/exporter/elasticsearchexporter/config_test.go +++ b/exporter/elasticsearchexporter/config_test.go @@ -330,7 +330,6 @@ func TestConfig(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(strings.ReplaceAll(tt.id.String(), "/", "_"), func(t *testing.T) { factory := NewFactory() cfg := factory.CreateDefaultConfig() diff --git a/exporter/elasticsearchexporter/exporter_test.go b/exporter/elasticsearchexporter/exporter_test.go index 08107eea5795..5554c089e02b 100644 --- a/exporter/elasticsearchexporter/exporter_test.go +++ b/exporter/elasticsearchexporter/exporter_test.go @@ -562,11 +562,9 @@ func TestExporterLogs(t *testing.T) { } for name, handler := range handlers { - handler := handler t.Run(name, func(t *testing.T) { t.Parallel() for name, configurer := range configurations { - configurer := configurer t.Run(name, func(t *testing.T) { t.Parallel() attempts := &atomic.Int64{} diff --git a/exporter/elasticsearchexporter/mapping_hint_test.go b/exporter/elasticsearchexporter/mapping_hint_test.go index 00ff4f9b3117..b0d8aae4dd0a 100644 --- a/exporter/elasticsearchexporter/mapping_hint_test.go +++ b/exporter/elasticsearchexporter/mapping_hint_test.go @@ -80,7 +80,6 @@ func TestHasHint(t *testing.T) { }, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { assert.Equal(t, tt.want, newMappingHintGetter(tt.attrsFunc()).HasMappingHint(tt.hint)) })