1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-23 22:34:47 +02:00

Add unconvert linter (#5529)

This adds the unconvert linter, and fixes every new issue related to it.

Co-authored-by: Sam Xie <sam@samxie.me>
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
This commit is contained in:
Damien Mathieu
2024-06-22 00:00:26 +02:00
committed by GitHub
parent 4a509d24e2
commit 3e91436a3b
15 changed files with 19 additions and 18 deletions

View File

@@ -376,7 +376,7 @@ func TestConfigs(t *testing.T) {
{
name: "Test With Timeout",
opts: []GenericOption{
WithTimeout(time.Duration(5 * time.Second)),
WithTimeout(5 * time.Second),
},
asserts: func(t *testing.T, c *Config, grpcOption bool) {
assert.Equal(t, 5*time.Second, c.Metrics.Timeout)

View File

@@ -79,7 +79,7 @@ func metric(m metricdata.Metrics) (*mpb.Metric, error) {
out := &mpb.Metric{
Name: m.Name,
Description: m.Description,
Unit: string(m.Unit),
Unit: m.Unit,
}
switch a := m.Data.(type) {
case metricdata.Gauge[int64]:

View File

@@ -372,7 +372,7 @@ func TestConfigs(t *testing.T) {
{
name: "Test With Timeout",
opts: []GenericOption{
WithTimeout(time.Duration(5 * time.Second)),
WithTimeout(5 * time.Second),
},
asserts: func(t *testing.T, c *Config, grpcOption bool) {
assert.Equal(t, 5*time.Second, c.Traces.Timeout)