diff --git a/config/configauth/authenticator.go b/config/configauth/authenticator.go index 62325a3e91e2..1c050ee38963 100644 --- a/config/configauth/authenticator.go +++ b/config/configauth/authenticator.go @@ -63,7 +63,7 @@ func NewAuthenticator(cfg Authentication) (Authenticator, error) { return newOIDCAuthenticator(cfg) } -func defaultUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler, authenticate authenticateFunc) (interface{}, error) { +func defaultUnaryInterceptor(ctx context.Context, req interface{}, _ *grpc.UnaryServerInfo, handler grpc.UnaryHandler, authenticate authenticateFunc) (interface{}, error) { headers, ok := metadata.FromIncomingContext(ctx) if !ok { return nil, errMetadataNotFound @@ -77,7 +77,7 @@ func defaultUnaryInterceptor(ctx context.Context, req interface{}, info *grpc.Un return handler(ctx, req) } -func defaultStreamInterceptor(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler, authenticate authenticateFunc) error { +func defaultStreamInterceptor(srv interface{}, stream grpc.ServerStream, _ *grpc.StreamServerInfo, handler grpc.StreamHandler, authenticate authenticateFunc) error { ctx := stream.Context() headers, ok := metadata.FromIncomingContext(ctx) if !ok { diff --git a/exporter/fileexporter/file_exporter.go b/exporter/fileexporter/file_exporter.go index b9053cfa8066..ab0c32607b15 100644 --- a/exporter/fileexporter/file_exporter.go +++ b/exporter/fileexporter/file_exporter.go @@ -63,7 +63,7 @@ func exportMessageAsLine(e *fileExporter, message proto.Message) error { return nil } -func (e *fileExporter) Start(ctx context.Context, host component.Host) error { +func (e *fileExporter) Start(context.Context, component.Host) error { return nil } diff --git a/exporter/prometheusexporter/collector_test.go b/exporter/prometheusexporter/collector_test.go index e47954cb2b3c..1c63881ca591 100644 --- a/exporter/prometheusexporter/collector_test.go +++ b/exporter/prometheusexporter/collector_test.go @@ -31,11 +31,11 @@ type mockAccumulator struct { metrics []pdata.Metric } -func (a *mockAccumulator) Accumulate(rm pdata.ResourceMetrics) (n int) { +func (a *mockAccumulator) Accumulate(pdata.ResourceMetrics) (n int) { return 0 } -func (a *mockAccumulator) Collect() []pdata.Metric { +func (a *mockAccumulator) Collect() []pdata.Metric { return a.metrics } @@ -110,7 +110,7 @@ func (c *errorCheckCore) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zap } return ce } -func (c *errorCheckCore) Write(ent zapcore.Entry, field []zapcore.Field) error { +func (c *errorCheckCore) Write(ent zapcore.Entry, _ []zapcore.Field) error { if ent.Level == zapcore.ErrorLevel { c.errorMessages = append(c.errorMessages, ent.Message) } diff --git a/exporter/prometheusexporter/prometheus.go b/exporter/prometheusexporter/prometheus.go index 3ececfc62bd1..33a0a0897cd5 100644 --- a/exporter/prometheusexporter/prometheus.go +++ b/exporter/prometheusexporter/prometheus.go @@ -101,6 +101,6 @@ func (pe *prometheusExporter) ConsumeMetrics(ctx context.Context, md pdata.Metri return nil } -func (pe *prometheusExporter) Shutdown(ctx context.Context) error { +func (pe *prometheusExporter) Shutdown(_ context.Context) error { return pe.shutdownFunc() } diff --git a/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go b/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go index 756e5c4f2097..f53af7b31254 100644 --- a/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go +++ b/receiver/hostmetricsreceiver/internal/scraper/processscraper/process_scraper_test.go @@ -181,7 +181,7 @@ type processHandlesMock struct { handles []*processHandleMock } -func (p *processHandlesMock) Pid(index int) int32 { +func (p *processHandlesMock) Pid(int) int32 { return 1 } diff --git a/receiver/kafkareceiver/factory_test.go b/receiver/kafkareceiver/factory_test.go index 855d76aa80d4..1c8f8f3a31f9 100644 --- a/receiver/kafkareceiver/factory_test.go +++ b/receiver/kafkareceiver/factory_test.go @@ -85,7 +85,7 @@ type customUnamarshaller struct { var _ Unmarshaller = (*customUnamarshaller)(nil) -func (c customUnamarshaller) Unmarshal(bytes []byte) (pdata.Traces, error) { +func (c customUnamarshaller) Unmarshal([]byte) (pdata.Traces, error) { panic("implement me") } diff --git a/receiver/kafkareceiver/kafka_receiver_test.go b/receiver/kafkareceiver/kafka_receiver_test.go index 515a36c61577..c914da0f8ea0 100644 --- a/receiver/kafkareceiver/kafka_receiver_test.go +++ b/receiver/kafkareceiver/kafka_receiver_test.go @@ -282,15 +282,15 @@ func (t testConsumerGroupSession) GenerationID() int32 { panic("implement me") } -func (t testConsumerGroupSession) MarkOffset(topic string, partition int32, offset int64, metadata string) { +func (t testConsumerGroupSession) MarkOffset(string, int32, int64, string) { panic("implement me") } -func (t testConsumerGroupSession) ResetOffset(topic string, partition int32, offset int64, metadata string) { +func (t testConsumerGroupSession) ResetOffset(string, int32, int64, string) { panic("implement me") } -func (t testConsumerGroupSession) MarkMessage(msg *sarama.ConsumerMessage, metadata string) { +func (t testConsumerGroupSession) MarkMessage(*sarama.ConsumerMessage, string) { } func (t testConsumerGroupSession) Context() context.Context { diff --git a/receiver/prometheusreceiver/metrics_receiver.go b/receiver/prometheusreceiver/metrics_receiver.go index 1dbd808b056a..9d8edb89059a 100644 --- a/receiver/prometheusreceiver/metrics_receiver.go +++ b/receiver/prometheusreceiver/metrics_receiver.go @@ -51,7 +51,7 @@ func newPrometheusReceiver(logger *zap.Logger, cfg *Config, next consumer.Metric // Start is the method that starts Prometheus scraping and it // is controlled by having previously defined a Configuration using perhaps New. -func (r *pReceiver) Start(ctx context.Context, host component.Host) error { +func (r *pReceiver) Start(_ context.Context, host component.Host) error { discoveryCtx, cancel := context.WithCancel(context.Background()) r.cancelFunc = cancel diff --git a/receiver/zipkinreceiver/trace_receiver.go b/receiver/zipkinreceiver/trace_receiver.go index 004e3395db42..fa9a1d319f60 100644 --- a/receiver/zipkinreceiver/trace_receiver.go +++ b/receiver/zipkinreceiver/trace_receiver.go @@ -83,7 +83,7 @@ func New(config *Config, nextConsumer consumer.Traces) (*ZipkinReceiver, error) } // Start spins up the receiver's HTTP server and makes the receiver start its processing. -func (zr *ZipkinReceiver) Start(ctx context.Context, host component.Host) error { +func (zr *ZipkinReceiver) Start(_ context.Context, host component.Host) error { if host == nil { return errors.New("nil host") }