Skip to content

Commit

Permalink
[chore] more unused params (open-telemetry#22922)
Browse files Browse the repository at this point in the history
Linked issue: open-telemetry#20424

Signed-off-by: Alex Boten <aboten@lightstep.com>
  • Loading branch information
Alex Boten authored and Caleb-Hurshman committed Jul 6, 2023
1 parent 26cb437 commit bece452
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion connector/spanmetricsconnector/connector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func verifyConsumeMetricsInputCumulative(t testing.TB, input pmetric.Metrics) bo
return verifyConsumeMetricsInput(t, input, pmetric.AggregationTemporalityCumulative, 1)
}

func verifyBadMetricsOkay(t testing.TB, input pmetric.Metrics) bool {
func verifyBadMetricsOkay(_ testing.TB, _ pmetric.Metrics) bool {
return true // Validating no exception
}

Expand Down
2 changes: 1 addition & 1 deletion exporter/alibabacloudlogserviceexporter/logs_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type logServiceLogsSender struct {
}

func (s *logServiceLogsSender) pushLogsData(
ctx context.Context,
_ context.Context,
md plog.Logs) error {
var err error
slsLogs := logDataToLogService(md)
Expand Down
12 changes: 6 additions & 6 deletions exporter/logzioexporter/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type hclog2ZapLogger struct {
name string
}

func (l *hclog2ZapLogger) Log(level hclog.Level, msg string, args ...interface{}) {}
func (l *hclog2ZapLogger) Log(_ hclog.Level, _ string, _ ...interface{}) {}

func (l *hclog2ZapLogger) ImpliedArgs() []interface{} {
return nil
Expand All @@ -30,12 +30,12 @@ func (l *hclog2ZapLogger) Name() string {
return l.name
}

func (l *hclog2ZapLogger) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer {
func (l *hclog2ZapLogger) StandardWriter(_ *hclog.StandardLoggerOptions) io.Writer {
return nil
}

// Trace implementation.
func (l *hclog2ZapLogger) Trace(msg string, args ...interface{}) {}
func (l *hclog2ZapLogger) Trace(_ string, _ ...interface{}) {}

// Debug implementation.
func (l *hclog2ZapLogger) Debug(msg string, args ...interface{}) {
Expand Down Expand Up @@ -83,13 +83,13 @@ func (l *hclog2ZapLogger) Named(name string) hclog.Logger {
}

// ResetNamed implementation.
func (l *hclog2ZapLogger) ResetNamed(name string) hclog.Logger {
func (l *hclog2ZapLogger) ResetNamed(_ string) hclog.Logger {
// no need to implement that as go-plugin doesn't use this method.
return &hclog2ZapLogger{}
}

// SetLevel implementation.
func (l *hclog2ZapLogger) SetLevel(level hclog.Level) {
func (l *hclog2ZapLogger) SetLevel(_ hclog.Level) {
// no need to implement that as go-plugin doesn't use this method.
}

Expand All @@ -100,7 +100,7 @@ func (l *hclog2ZapLogger) GetLevel() hclog.Level {
}

// StandardLogger implementation.
func (l *hclog2ZapLogger) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger {
func (l *hclog2ZapLogger) StandardLogger(_ *hclog.StandardLoggerOptions) *log.Logger {
// no need to implement that as go-plugin doesn't use this method.
return log.New(io.Discard, "", 0)
}
Expand Down
4 changes: 2 additions & 2 deletions internal/aws/awsutil/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type mockConn struct {
sn *session.Session
}

func (c *mockConn) getEC2Region(s *session.Session) (string, error) {
func (c *mockConn) getEC2Region(_ *session.Session) (string, error) {
args := c.Called(nil)
errorStr := args.String(0)
var err error
Expand All @@ -32,7 +32,7 @@ func (c *mockConn) getEC2Region(s *session.Session) (string, error) {
return ec2Region, nil
}

func (c *mockConn) newAWSSession(logger *zap.Logger, roleArn string, region string) (*session.Session, error) {
func (c *mockConn) newAWSSession(_ *zap.Logger, _ string, _ string) (*session.Session, error) {
return c.sn, nil
}

Expand Down
4 changes: 2 additions & 2 deletions internal/aws/proxy/conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ type mock struct {
sn *session.Session
}

func (m *mock) getEC2Region(s *session.Session) (string, error) {
func (m *mock) getEC2Region(_ *session.Session) (string, error) {
if m.getEC2RegionErr != nil {
return "", m.getEC2RegionErr
}
return ec2Region, nil
}

func (m *mock) newAWSSession(roleArn string, region string, logger *zap.Logger) (*session.Session, error) {
func (m *mock) newAWSSession(_ string, _ string, _ *zap.Logger) (*session.Session, error) {
return m.sn, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/ottl/contexts/ottlscope/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func NewStatements(statements []*ottl.Statement[TransformContext], telemetrySett
return s
}

func parseEnum(val *ottl.EnumSymbol) (*ottl.Enum, error) {
func parseEnum(_ *ottl.EnumSymbol) (*ottl.Enum, error) {
return nil, fmt.Errorf("instrumentation scope context does not provide Enum support")
}

Expand Down
2 changes: 1 addition & 1 deletion receiver/k8seventsreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func newReceiver(
}, nil
}

func (kr *k8seventsReceiver) Start(ctx context.Context, host component.Host) error {
func (kr *k8seventsReceiver) Start(ctx context.Context, _ component.Host) error {
kr.ctx, kr.cancel = context.WithCancel(ctx)

kr.settings.Logger.Info("starting to watch namespaces for the events.")
Expand Down
2 changes: 1 addition & 1 deletion receiver/k8sobjectsreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func newReceiver(params receiver.CreateSettings, config *Config, consumer consum
}, nil
}

func (kr *k8sobjectsreceiver) Start(ctx context.Context, host component.Host) error {
func (kr *k8sobjectsreceiver) Start(ctx context.Context, _ component.Host) error {
kr.setting.Logger.Info("Object Receiver started")

for _, object := range kr.objects {
Expand Down
4 changes: 2 additions & 2 deletions receiver/mongodbatlasreceiver/access_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func newAccessLogsReceiver(settings rcvr.CreateSettings, cfg *Config, consumer c
return r
}

func (alr *accessLogsReceiver) Start(ctx context.Context, host component.Host, storageClient storage.Client) error {
func (alr *accessLogsReceiver) Start(ctx context.Context, _ component.Host, storageClient storage.Client) error {
alr.logger.Debug("Starting up access log receiver")
cancelCtx, cancel := context.WithCancel(ctx)
alr.cancel = cancel
Expand All @@ -92,7 +92,7 @@ func (alr *accessLogsReceiver) Start(ctx context.Context, host component.Host, s
return alr.startPolling(cancelCtx)
}

func (alr *accessLogsReceiver) Shutdown(ctx context.Context) error {
func (alr *accessLogsReceiver) Shutdown(_ context.Context) error {
alr.logger.Debug("Shutting down accessLog receiver")
alr.cancel()
alr.wg.Wait()
Expand Down
2 changes: 1 addition & 1 deletion receiver/mongodbatlasreceiver/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func newEventsReceiver(settings rcvr.CreateSettings, c *Config, consumer consume
return r
}

func (er *eventsReceiver) Start(ctx context.Context, host component.Host, storageClient storage.Client) error {
func (er *eventsReceiver) Start(ctx context.Context, _ component.Host, storageClient storage.Client) error {
er.logger.Debug("Starting up events receiver")
cancelCtx, cancel := context.WithCancel(ctx)
er.cancel = cancel
Expand Down
2 changes: 1 addition & 1 deletion receiver/mongodbatlasreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func createMetricsReceiver(
}

func createCombinedLogReceiver(
ctx context.Context,
_ context.Context,
params rcvr.CreateSettings,
rConf component.Config,
consumer consumer.Logs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ func getRecordFunc(metricName string) metricRecordFunc {
}
}

func MeasurementsToMetric(mb *MetricsBuilder, meas *mongodbatlas.Measurements, buildUnrecognized bool) error {
func MeasurementsToMetric(mb *MetricsBuilder, meas *mongodbatlas.Measurements, _ bool) error {
recordFunc := getRecordFunc(meas.Name)
if recordFunc == nil {
return nil
Expand Down
4 changes: 2 additions & 2 deletions receiver/mongodbatlasreceiver/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func newMongoDBAtlasLogsReceiver(settings rcvr.CreateSettings, cfg *Config, cons
}

// Log receiver logic
func (s *logsReceiver) Start(ctx context.Context, host component.Host) error {
func (s *logsReceiver) Start(ctx context.Context, _ component.Host) error {
s.wg.Add(1)
go func() {
defer s.wg.Done()
Expand All @@ -83,7 +83,7 @@ func (s *logsReceiver) Start(ctx context.Context, host component.Host) error {
return nil
}

func (s *logsReceiver) Shutdown(ctx context.Context) error {
func (s *logsReceiver) Shutdown(_ context.Context) error {
close(s.stopperChan)
s.wg.Wait()
return s.client.Shutdown()
Expand Down
2 changes: 1 addition & 1 deletion receiver/mongodbreceiver/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (c *mongodbClient) TopStats(ctx context.Context) (bson.M, error) {
// more information can be found here: https://pkg.go.dev/go.mongodb.org/mongo-driver@v1.9.0/mongo#Database.ListCollectionNames
func (c *mongodbClient) ListCollectionNames(ctx context.Context, database string) ([]string, error) {
lcOpts := options.ListCollections().SetAuthorizedCollections(true)
return c.Database(database).ListCollectionNames(context.Background(), bson.D{}, lcOpts)
return c.Database(database).ListCollectionNames(ctx, bson.D{}, lcOpts)
}

// IndexStats returns the index stats per collection for a given database
Expand Down
2 changes: 1 addition & 1 deletion receiver/mysqlreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func newMySQLScraper(
}

// start starts the scraper by initializing the db client connection.
func (m *mySQLScraper) start(_ context.Context, host component.Host) error {
func (m *mySQLScraper) start(_ context.Context, _ component.Host) error {
sqlclient := newMySQLClient(m.config)

err := sqlclient.Connect()
Expand Down
2 changes: 1 addition & 1 deletion receiver/nsxtreceiver/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func createDefaultConfig() component.Config {
}
}

func createMetricsReceiver(ctx context.Context, params receiver.CreateSettings, rConf component.Config, consumer consumer.Metrics) (receiver.Metrics, error) {
func createMetricsReceiver(_ context.Context, params receiver.CreateSettings, rConf component.Config, consumer consumer.Metrics) (receiver.Metrics, error) {
cfg, ok := rConf.(*Config)
if !ok {
return nil, errConfigNotNSX
Expand Down
2 changes: 1 addition & 1 deletion receiver/nsxtreceiver/scraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func newScraper(cfg *Config, settings receiver.CreateSettings) *scraper {
}
}

func (s *scraper) start(ctx context.Context, host component.Host) error {
func (s *scraper) start(_ context.Context, host component.Host) error {
s.host = host
client, err := newClient(s.config, s.settings, s.host, s.settings.Logger)
if err != nil {
Expand Down

0 comments on commit bece452

Please sign in to comment.