Skip to content

Commit

Permalink
Make IDE happy, remove unused params or replace with _ (#2772)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Mar 23, 2021
1 parent c31e762 commit a20fba1
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions config/configauth/authenticator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion exporter/fileexporter/file_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
6 changes: 3 additions & 3 deletions exporter/prometheusexporter/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion exporter/prometheusexporter/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ type processHandlesMock struct {
handles []*processHandleMock
}

func (p *processHandlesMock) Pid(index int) int32 {
func (p *processHandlesMock) Pid(int) int32 {
return 1
}

Expand Down
2 changes: 1 addition & 1 deletion receiver/kafkareceiver/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand Down
6 changes: 3 additions & 3 deletions receiver/kafkareceiver/kafka_receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion receiver/prometheusreceiver/metrics_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion receiver/zipkinreceiver/trace_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit a20fba1

Please sign in to comment.