Skip to content

Commit

Permalink
[chore] test that implementation implements interface without allocat…
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdandrutu authored and steves-canva committed Jun 13, 2024
1 parent 2d50bbd commit 7c59865
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions otelcol/configprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ type configProvider struct {
mapResolver *confmap.Resolver
}

var _ ConfigProvider = &configProvider{}
var _ ConfmapProvider = &configProvider{}
var _ ConfigProvider = (*configProvider)(nil)
var _ ConfmapProvider = (*configProvider)(nil)

// ConfigProviderSettings are the settings to configure the behavior of the ConfigProvider.
type ConfigProviderSettings struct {
Expand Down
2 changes: 1 addition & 1 deletion service/internal/graph/graph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"go.opentelemetry.io/collector/service/pipelines"
)

var _ component.Component = &testNode{}
var _ component.Component = (*testNode)(nil)

type testNode struct {
id component.ID
Expand Down
10 changes: 5 additions & 5 deletions service/internal/graph/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (n *receiverNode) buildComponent(ctx context.Context,
return nil
}

var _ consumerNode = &processorNode{}
var _ consumerNode = (*processorNode)(nil)

// Every processor instance is unique to one pipeline.
// Therefore, nodeID is derived from "pipeline ID" and "component ID".
Expand Down Expand Up @@ -152,7 +152,7 @@ func (n *processorNode) buildComponent(ctx context.Context,
return nil
}

var _ consumerNode = &exporterNode{}
var _ consumerNode = (*exporterNode)(nil)

// An exporter instance can be shared by multiple pipelines of the same type.
// Therefore, nodeID is derived from "pipeline type" and "component ID".
Expand Down Expand Up @@ -200,7 +200,7 @@ func (n *exporterNode) buildComponent(
return nil
}

var _ consumerNode = &connectorNode{}
var _ consumerNode = (*connectorNode)(nil)

// A connector instance connects one pipeline type to one other pipeline type.
// Therefore, nodeID is derived from "exporter pipeline type", "receiver pipeline type", and "component ID".
Expand Down Expand Up @@ -347,7 +347,7 @@ func (n *connectorNode) buildComponent(
return nil
}

var _ consumerNode = &capabilitiesNode{}
var _ consumerNode = (*capabilitiesNode)(nil)

// Every pipeline has a "virtual" capabilities node immediately after the receiver(s).
// There are two purposes for this node:
Expand All @@ -374,7 +374,7 @@ func (n *capabilitiesNode) getConsumer() baseConsumer {
return n
}

var _ consumerNode = &fanOutNode{}
var _ consumerNode = (*fanOutNode)(nil)

// Each pipeline has one fan-out node before exporters.
// Therefore, nodeID is derived from "pipeline ID".
Expand Down

0 comments on commit 7c59865

Please sign in to comment.