Skip to content

Commit df62b61

Browse files
Paulo Janottibogdandrutu
authored andcommitted
Make goimports observe local (#338)
This breaks on incorrect grouping imports and fixes the found ones.
1 parent ce5a945 commit df62b61

File tree

26 files changed

+53
-44
lines changed

26 files changed

+53
-44
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ lint:
9999

100100
.PHONY: goimports
101101
goimports:
102-
@IMPORTSOUT=`$(GOIMPORTS) -d . 2>&1`; \
102+
@IMPORTSOUT=`$(GOIMPORTS) -local github.com/open-telemetry/opentelemetry-service -d . 2>&1`; \
103103
if [ "$$IMPORTSOUT" ]; then \
104104
echo "$(GOIMPORTS) FAILED => fix the following goimports errors:\n"; \
105105
echo "$$IMPORTSOUT\n"; \

exporter/exporterhelper/metricshelper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ package exporterhelper
1717
import (
1818
"context"
1919

20-
"github.com/open-telemetry/opentelemetry-service/config/configmodels"
21-
"github.com/open-telemetry/opentelemetry-service/observability"
2220
"go.opencensus.io/trace"
2321

22+
"github.com/open-telemetry/opentelemetry-service/config/configmodels"
2423
"github.com/open-telemetry/opentelemetry-service/consumer/consumerdata"
2524
"github.com/open-telemetry/opentelemetry-service/exporter"
25+
"github.com/open-telemetry/opentelemetry-service/observability"
2626
)
2727

2828
// PushMetricsData is a helper function that is similar to ConsumeMetricsData but also returns

exporter/exportertest/nop_exporter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ import (
1818
"errors"
1919
"testing"
2020

21-
"github.com/stretchr/testify/require"
22-
2321
metricspb "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1"
2422
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
23+
"github.com/stretchr/testify/require"
24+
2525
"github.com/open-telemetry/opentelemetry-service/consumer/consumerdata"
2626
)
2727

exporter/exportertest/sink_exporter_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ import (
1717
"context"
1818
"testing"
1919

20+
metricspb "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1"
21+
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
2022
"github.com/stretchr/testify/assert"
2123
"github.com/stretchr/testify/require"
2224

23-
metricspb "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1"
24-
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
2525
"github.com/open-telemetry/opentelemetry-service/consumer/consumerdata"
2626
)
2727

exporter/prometheusexporter/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ import (
1919
"net/http"
2020
"strings"
2121

22+
"github.com/orijtech/prometheus-go-metrics-exporter"
2223
"go.uber.org/zap"
2324

2425
"github.com/open-telemetry/opentelemetry-service/config/configerror"
2526
"github.com/open-telemetry/opentelemetry-service/config/configmodels"
2627
"github.com/open-telemetry/opentelemetry-service/exporter"
27-
"github.com/orijtech/prometheus-go-metrics-exporter"
2828
)
2929

3030
const (

observability/observability_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ import (
2020
"context"
2121
"testing"
2222

23+
"github.com/stretchr/testify/require"
24+
2325
"github.com/open-telemetry/opentelemetry-service/observability"
2426
"github.com/open-telemetry/opentelemetry-service/observability/observabilitytest"
25-
"github.com/stretchr/testify/require"
2627
)
2728

2829
const (

observability/observabilitytest/observabilitytest_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ import (
2020
"context"
2121
"testing"
2222

23+
"github.com/stretchr/testify/require"
24+
2325
"github.com/open-telemetry/opentelemetry-service/observability"
2426
"github.com/open-telemetry/opentelemetry-service/observability/observabilitytest"
25-
"github.com/stretchr/testify/require"
2627
)
2728

2829
const (

processor/fanoutconnector_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121

2222
metricspb "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1"
2323
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
24+
2425
"github.com/open-telemetry/opentelemetry-service/consumer"
2526
"github.com/open-telemetry/opentelemetry-service/consumer/consumerdata"
2627
)

processor/nodebatcherprocessor/node_batcher_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ import (
2323
commonpb "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
2424
resourcepb "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
2525
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
26-
"github.com/open-telemetry/opentelemetry-service/consumer/consumerdata"
2726
"go.uber.org/zap"
27+
28+
"github.com/open-telemetry/opentelemetry-service/consumer/consumerdata"
2829
)
2930

3031
type bucketIDTestInput struct {

processor/probabilisticsamplerprocessor/probabilisticsampler_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323

2424
commonpb "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
2525
tracepb "github.com/census-instrumentation/opencensus-proto/gen-go/trace/v1"
26+
2627
"github.com/open-telemetry/opentelemetry-service/consumer"
2728
"github.com/open-telemetry/opentelemetry-service/consumer/consumerdata"
2829
"github.com/open-telemetry/opentelemetry-service/exporter/exportertest"

0 commit comments

Comments
 (0)