Skip to content

Commit 61510e8

Browse files
crobert-1cparkins
authored andcommitted
[chore] Enable all (passing) goleak checks (open-telemetry#30451)
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> This PR contains 3 main changes: 1. Make a copy of the same file into every package whose `goleak` check is currently passing. The only change for the `package_test.go` file in each package is the package name itself. 2. Rename `processor/tailsamplingprocessor/main_test.go` to `package_test.go` for uniformity. `package_test.go` is the name we chose for core (see discussion [here](open-telemetry/opentelemetry-collector#9173 (comment))). 3. Run `make gotidy` to add `goleak` dependency. I included the script used to make these changes [in the issue](open-telemetry#30438 (comment)). **Link to tracking Issue:** <Issue number if applicable> open-telemetry#30438
1 parent 4beec16 commit 61510e8

File tree

340 files changed

+2989
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

340 files changed

+2989
-1
lines changed

cmd/opampsupervisor/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ require (
1313
github.com/stretchr/testify v1.8.4
1414
go.opentelemetry.io/collector/config/configtls v0.92.1-0.20240117180253-4371e14440ee
1515
go.opentelemetry.io/collector/semconv v0.92.1-0.20240117180253-4371e14440ee
16+
go.uber.org/goleak v1.3.0
1617
go.uber.org/zap v1.26.0
1718
)
1819

cmd/opampsupervisor/go.sum

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package supervisor
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

cmd/telemetrygen/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ require (
1919
go.opentelemetry.io/otel/sdk v1.21.0
2020
go.opentelemetry.io/otel/sdk/metric v1.21.0
2121
go.opentelemetry.io/otel/trace v1.21.0
22+
go.uber.org/goleak v1.3.0
2223
go.uber.org/zap v1.26.0
2324
golang.org/x/time v0.5.0
2425
google.golang.org/grpc v1.60.1

cmd/telemetrygen/go.sum

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package common
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package logs
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package metrics
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package traces
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

confmap/provider/s3provider/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ require (
88
github.com/aws/aws-sdk-go-v2/service/s3 v1.48.0
99
github.com/stretchr/testify v1.8.4
1010
go.opentelemetry.io/collector/confmap v0.92.1-0.20240117180253-4371e14440ee
11+
go.uber.org/goleak v1.3.0
1112
gopkg.in/yaml.v2 v2.4.0
1213
)
1314

confmap/provider/s3provider/go.sum

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package s3provider
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

connector/spanmetricsconnector/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ require (
1717
go.opentelemetry.io/collector/semconv v0.92.1-0.20240117180253-4371e14440ee
1818
go.opentelemetry.io/otel/metric v1.21.0
1919
go.opentelemetry.io/otel/trace v1.21.0
20+
go.uber.org/goleak v1.3.0
2021
go.uber.org/zap v1.26.0
2122
google.golang.org/grpc v1.60.1
2223
)

connector/spanmetricsconnector/go.sum

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package cache
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package metrics
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

exporter/awskinesisexporter/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ require (
2323
go.opentelemetry.io/collector/pdata v1.0.2-0.20240117180253-4371e14440ee
2424
go.opentelemetry.io/otel/metric v1.21.0
2525
go.opentelemetry.io/otel/trace v1.21.0
26+
go.uber.org/goleak v1.3.0
2627
go.uber.org/multierr v1.11.0
2728
go.uber.org/zap v1.26.0
2829
)

exporter/awskinesisexporter/go.sum

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package batch
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package compress
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package key
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package producer
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

exporter/awsxrayexporter/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ require (
1717
go.opentelemetry.io/collector/semconv v0.92.1-0.20240117180253-4371e14440ee
1818
go.opentelemetry.io/otel/metric v1.21.0
1919
go.opentelemetry.io/otel/trace v1.21.0
20+
go.uber.org/goleak v1.3.0
2021
go.uber.org/zap v1.26.0
2122
)
2223

exporter/awsxrayexporter/go.sum

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package translator
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

exporter/clickhouseexporter/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ require (
1616
go.opentelemetry.io/collector/semconv v0.92.1-0.20240117180253-4371e14440ee
1717
go.opentelemetry.io/otel/metric v1.21.0
1818
go.opentelemetry.io/otel/trace v1.21.0
19+
go.uber.org/goleak v1.3.0
1920
go.uber.org/zap v1.26.0
2021
)
2122

exporter/clickhouseexporter/go.sum

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package internal
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

exporter/datadogexporter/go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ require (
5151
go.opentelemetry.io/collector/semconv v0.92.1-0.20240117180253-4371e14440ee
5252
go.opentelemetry.io/otel/metric v1.21.0
5353
go.opentelemetry.io/otel/trace v1.21.0
54+
go.uber.org/goleak v1.3.0
5455
go.uber.org/zap v1.26.0
5556
google.golang.org/protobuf v1.32.0
5657
gopkg.in/yaml.v2 v2.4.0

exporter/datadogexporter/go.sum

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package azure
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package ec2
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package ecs
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright The OpenTelemetry Authors
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
package gcp
5+
6+
import (
7+
"testing"
8+
9+
"go.uber.org/goleak"
10+
)
11+
12+
func TestMain(m *testing.M) {
13+
goleak.VerifyTestMain(m)
14+
}

0 commit comments

Comments
 (0)