Skip to content

Commit

Permalink
Add lint check for duplicated imports (#439)
Browse files Browse the repository at this point in the history
* Enable duplicated imports check

* Remove duplicated import
  • Loading branch information
damemi authored Jun 23, 2022
1 parent 51b1cec commit d559024
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 1 addition & 2 deletions exporter/collector/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"cloud.google.com/go/logging"
loggingv2 "cloud.google.com/go/logging/apiv2"
"google.golang.org/genproto/googleapis/api/monitoredres"
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
logpb "google.golang.org/genproto/googleapis/logging/v2"
"google.golang.org/protobuf/proto"

Expand Down Expand Up @@ -239,7 +238,7 @@ func (l logMapper) logEntryToInternal(
entry logging.Entry,
logName string,
projectID string,
mr *monitoredrespb.MonitoredResource,
mr *monitoredres.MonitoredResource,
splits int,
splitIndex int,
) (*logpb.LogEntry, error) {
Expand Down
3 changes: 1 addition & 2 deletions exporter/metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (

monitoring "cloud.google.com/go/monitoring/apiv3/v2"
"google.golang.org/api/option"
apioption "google.golang.org/api/option"
"google.golang.org/genproto/googleapis/api/distribution"
googlemetricpb "google.golang.org/genproto/googleapis/api/metric"
monitoredrespb "google.golang.org/genproto/googleapis/api/monitoredres"
Expand Down Expand Up @@ -129,7 +128,7 @@ func newMetricExporter(o *options) (*metricExporter, error) {
return nil, errBlankProjectID
}

clientOpts := append([]apioption.ClientOption{option.WithUserAgent(userAgent)}, o.monitoringClientOptions...)
clientOpts := append([]option.ClientOption{option.WithUserAgent(userAgent)}, o.monitoringClientOptions...)
ctx := o.context
if ctx == nil {
ctx = context.Background()
Expand Down
7 changes: 3 additions & 4 deletions exporter/metric/metric_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/sdk/instrumentation"
"go.opentelemetry.io/otel/sdk/metric/controller/basic"
controller "go.opentelemetry.io/otel/sdk/metric/controller/basic"
"go.opentelemetry.io/otel/sdk/metric/export"
"go.opentelemetry.io/otel/sdk/metric/export/aggregation"
Expand Down Expand Up @@ -94,7 +93,7 @@ func TestExportCounter(t *testing.T) {

clientOpt := option.WithGRPCConn(cloudMock.ClientConn())

resOpt := basic.WithResource(
resOpt := controller.WithResource(
resource.NewWithAttributes(
semconv.SchemaURL,
attribute.String("test_id", "abc123"),
Expand Down Expand Up @@ -130,7 +129,7 @@ func TestExportHistogram(t *testing.T) {

clientOpt := option.WithGRPCConn(cloudMock.ClientConn())

resOpt := basic.WithResource(
resOpt := controller.WithResource(
resource.NewWithAttributes(
semconv.SchemaURL,
attribute.String("test_id", "abc123"),
Expand Down Expand Up @@ -199,7 +198,7 @@ func TestRecordToMpb(t *testing.T) {

clientOpt := option.WithGRPCConn(cloudMock.ClientConn())

resOpt := basic.WithResource(
resOpt := controller.WithResource(
resource.NewWithAttributes(
semconv.SchemaURL,
attribute.String("test_id", "abc123"),
Expand Down
3 changes: 3 additions & 0 deletions golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ linters-settings:
- metres
- kilometre
- kilometres
revive:
rules:
- name: duplicated-imports

linters:
disable-all: true
Expand Down

0 comments on commit d559024

Please sign in to comment.