Skip to content

Commit 6824191

Browse files
paulojmdiastommyers-elastic
authored andcommitted
[chore][exporter/alibabacloudlogserviceexporter] run make modernize (open-telemetry#43234)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Run the `make modernize` tool. https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize Signed-off-by: Paulo Dias <[email protected]>
1 parent 6c00e98 commit 6824191

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

exporter/alibabacloudlogserviceexporter/logs_exporter_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func createSimpleLogData(numberOfLogs int) plog.Logs {
2525
rl.ScopeLogs().AppendEmpty() // Add an empty ScopeLogs
2626
sl := rl.ScopeLogs().AppendEmpty()
2727

28-
for i := 0; i < numberOfLogs; i++ {
28+
for i := range numberOfLogs {
2929
ts := pcommon.Timestamp(int64(i) * time.Millisecond.Nanoseconds())
3030
logRecord := sl.LogRecords().AppendEmpty()
3131
logRecord.Body().SetStr("mylog")

exporter/alibabacloudlogserviceexporter/logsdata_to_logservice_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func createLogData(numberOfLogs int) plog.Logs {
3636
sl.Scope().SetName("collector")
3737
sl.Scope().SetVersion("v0.1.0")
3838

39-
for i := 0; i < numberOfLogs; i++ {
39+
for i := range numberOfLogs {
4040
ts := pcommon.Timestamp(int64(i) * time.Millisecond.Nanoseconds())
4141
logRecord := sl.LogRecords().AppendEmpty()
4242
switch i {
@@ -96,7 +96,7 @@ func TestLogsDataToLogService(t *testing.T) {
9696
t.Errorf("Failed load log key value pairs from %q: %v", resultLogFile, err)
9797
return
9898
}
99-
for j := 0; j < validLogCount; j++ {
99+
for j := range validLogCount {
100100
sort.Sort(logKeyValuePairs(gotLogPairs[j]))
101101
sort.Sort(logKeyValuePairs(wantLogs[j]))
102102
assert.Equal(t, wantLogs[j], gotLogPairs[j])

exporter/alibabacloudlogserviceexporter/metricsdata_to_logservice.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func doubleHistogramMetricsToLogs(name string, data pmetric.HistogramDataPointSl
206206
bucketLabels := labels.Clone()
207207
bucketLabels.Append(bucketLabelKey, "")
208208
bucketLabels.Sort()
209-
for i := 0; i < bucketCount; i++ {
209+
for i := range bucketCount {
210210
bucket := dataPoint.BucketCounts().At(i)
211211
bucketLabels.Replace(bucketLabelKey, boundsStr[i])
212212

exporter/alibabacloudlogserviceexporter/metricsdata_to_logservice_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func TestMetricDataToLogService(t *testing.T) {
121121
return
122122
}
123123
assert.Len(t, gotLogs, len(wantLogs))
124-
for j := 0; j < len(gotLogs); j++ {
124+
for j := range gotLogs {
125125
sort.Sort(logKeyValuePairs(gotLogPairs[j]))
126126
sort.Sort(logKeyValuePairs(wantLogs[j]))
127127
assert.Equal(t, wantLogs[j], gotLogPairs[j])

exporter/alibabacloudlogserviceexporter/tracedata_to_logservice_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func TestTraceDataToLogService(t *testing.T) {
5252
t.Errorf("Failed load log key value pairs from %q: %v", resultLogFile, err)
5353
return
5454
}
55-
for j := 0; j < len(gotLogs); j++ {
55+
for j := range gotLogs {
5656
sort.Sort(logKeyValuePairs(gotLogPairs[j]))
5757
sort.Sort(logKeyValuePairs(wantLogs[j]))
5858
assert.Equal(t, wantLogs[j], gotLogPairs[j])

0 commit comments

Comments
 (0)