diff --git a/.golangci.yml b/.golangci.yml index 0030a986836..47829617feb 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -171,9 +171,6 @@ linters-settings: # do a clean-up and enable - name: unused-parameter disabled: true - # do a clean-up and enable - - name: unused-receiver - disabled: true # we use storage_v2, so... - name: var-naming disabled: true diff --git a/cmd/agent/app/builder_test.go b/cmd/agent/app/builder_test.go index f0ecea0cd75..2cf067c0ad7 100644 --- a/cmd/agent/app/builder_test.go +++ b/cmd/agent/app/builder_test.go @@ -182,11 +182,11 @@ func TestMultipleCollectorProxies(t *testing.T) { type fakeCollectorProxy struct{} -func (f fakeCollectorProxy) GetReporter() reporter.Reporter { +func (fakeCollectorProxy) GetReporter() reporter.Reporter { return fakeCollectorProxy{} } -func (f fakeCollectorProxy) GetManager() configmanager.ClientConfigManager { +func (fakeCollectorProxy) GetManager() configmanager.ClientConfigManager { return fakeCollectorProxy{} } @@ -202,7 +202,7 @@ func (fakeCollectorProxy) Close() error { return nil } -func (f fakeCollectorProxy) GetSamplingStrategy(_ context.Context, _ string) (*api_v2.SamplingStrategyResponse, error) { +func (fakeCollectorProxy) GetSamplingStrategy(_ context.Context, _ string) (*api_v2.SamplingStrategyResponse, error) { return nil, errors.New("no peers available") } diff --git a/cmd/agent/app/configmanager/grpc/manager.go b/cmd/agent/app/configmanager/grpc/manager.go index f941a178e6c..dd49ccbcff8 100644 --- a/cmd/agent/app/configmanager/grpc/manager.go +++ b/cmd/agent/app/configmanager/grpc/manager.go @@ -47,6 +47,6 @@ func (s *ConfigManagerProxy) GetSamplingStrategy(ctx context.Context, serviceNam } // GetBaggageRestrictions returns baggage restrictions from collector. -func (s *ConfigManagerProxy) GetBaggageRestrictions(_ context.Context, _ string) ([]*baggage.BaggageRestriction, error) { +func (*ConfigManagerProxy) GetBaggageRestrictions(_ context.Context, _ string) ([]*baggage.BaggageRestriction, error) { return nil, errors.New("baggage not implemented") } diff --git a/cmd/agent/app/customtransport/buffered_read_transport.go b/cmd/agent/app/customtransport/buffered_read_transport.go index 929457939ad..2d5b8573a9b 100644 --- a/cmd/agent/app/customtransport/buffered_read_transport.go +++ b/cmd/agent/app/customtransport/buffered_read_transport.go @@ -36,19 +36,19 @@ func NewTBufferedReadTransport(readBuf *bytes.Buffer) (*TBufferedReadTransport, // IsOpen does nothing as transport is not maintaining the connection // Required to maintain thrift.TTransport interface -func (p *TBufferedReadTransport) IsOpen() bool { +func (*TBufferedReadTransport) IsOpen() bool { return true } // Open does nothing as transport is not maintaining the connection // Required to maintain thrift.TTransport interface -func (p *TBufferedReadTransport) Open() error { +func (*TBufferedReadTransport) Open() error { return nil } // Close does nothing as transport is not maintaining the connection // Required to maintain thrift.TTransport interface -func (p *TBufferedReadTransport) Close() error { +func (*TBufferedReadTransport) Close() error { return nil } @@ -72,6 +72,6 @@ func (p *TBufferedReadTransport) Write(buf []byte) (int, error) { // Flush does nothing as udp server does not write responses back // Required to maintain thrift.TTransport interface -func (p *TBufferedReadTransport) Flush(_ context.Context) error { +func (*TBufferedReadTransport) Flush(_ context.Context) error { return nil } diff --git a/cmd/agent/app/reporter/grpc/reporter_test.go b/cmd/agent/app/reporter/grpc/reporter_test.go index 4a679cca8a7..19345ce8527 100644 --- a/cmd/agent/app/reporter/grpc/reporter_test.go +++ b/cmd/agent/app/reporter/grpc/reporter_test.go @@ -183,7 +183,7 @@ func TestReporter_MakeModelKeyValue(t *testing.T) { type mockMultitenantSpanHandler struct{} -func (h *mockMultitenantSpanHandler) PostSpans(ctx context.Context, r *api_v2.PostSpansRequest) (*api_v2.PostSpansResponse, error) { +func (*mockMultitenantSpanHandler) PostSpans(ctx context.Context, r *api_v2.PostSpansRequest) (*api_v2.PostSpansResponse, error) { md, ok := metadata.FromIncomingContext(ctx) if !ok { return &api_v2.PostSpansResponse{}, status.Errorf(codes.PermissionDenied, "missing tenant header") diff --git a/cmd/agent/app/servers/tbuffered_server_test.go b/cmd/agent/app/servers/tbuffered_server_test.go index 730132c1d4e..862bcb9a5fb 100644 --- a/cmd/agent/app/servers/tbuffered_server_test.go +++ b/cmd/agent/app/servers/tbuffered_server_test.go @@ -117,7 +117,7 @@ func (t *fakeTransport) Read(p []byte) (n int, err error) { return len(p), nil } -func (t *fakeTransport) Close() error { +func (*fakeTransport) Close() error { return nil } diff --git a/cmd/agent/app/servers/thriftudp/transport.go b/cmd/agent/app/servers/thriftudp/transport.go index 4579502061f..e124b16a102 100644 --- a/cmd/agent/app/servers/thriftudp/transport.go +++ b/cmd/agent/app/servers/thriftudp/transport.go @@ -93,7 +93,7 @@ func NewTUDPServerTransport(hostPort string) (*TUDPTransport, error) { // Open does nothing as connection is opened on creation // Required to maintain thrift.TTransport interface -func (p *TUDPTransport) Open() error { +func (*TUDPTransport) Open() error { return nil } @@ -131,7 +131,7 @@ func (p *TUDPTransport) Read(buf []byte) (int, error) { // RemainingBytes returns the max number of bytes (same as Thrift's StreamTransport) as we // do not know how many bytes we have left. -func (p *TUDPTransport) RemainingBytes() uint64 { +func (*TUDPTransport) RemainingBytes() uint64 { const maxSize = ^uint64(0) return maxSize } diff --git a/cmd/collector/app/collector.go b/cmd/collector/app/collector.go index 31c9e4532d8..e6bf7f98089 100644 --- a/cmd/collector/app/collector.go +++ b/cmd/collector/app/collector.go @@ -169,7 +169,7 @@ func (c *Collector) Start(options *flags.CollectorOptions) error { return nil } -func (c *Collector) publishOpts(cOpts *flags.CollectorOptions) { +func (*Collector) publishOpts(cOpts *flags.CollectorOptions) { safeexpvar.SetInt(metricNumWorkers, int64(cOpts.NumWorkers)) safeexpvar.SetInt(metricQueueSize, int64(cOpts.QueueSize)) } diff --git a/cmd/collector/app/collector_test.go b/cmd/collector/app/collector_test.go index 8c6bba951dc..fe7a79bc009 100644 --- a/cmd/collector/app/collector_test.go +++ b/cmd/collector/app/collector_test.go @@ -61,7 +61,7 @@ func (t *mockAggregator) HandleRootSpan(span *model.Span, logger *zap.Logger) { t.callCount.Add(1) } -func (t *mockAggregator) Start() {} +func (*mockAggregator) Start() {} func (t *mockAggregator) Close() error { t.closeCount.Add(1) @@ -146,11 +146,11 @@ func TestCollector_StartErrors(t *testing.T) { type mockStrategyStore struct{} -func (m *mockStrategyStore) GetSamplingStrategy(_ context.Context, serviceName string) (*api_v2.SamplingStrategyResponse, error) { +func (*mockStrategyStore) GetSamplingStrategy(_ context.Context, serviceName string) (*api_v2.SamplingStrategyResponse, error) { return &api_v2.SamplingStrategyResponse{}, nil } -func (m *mockStrategyStore) Close() error { +func (*mockStrategyStore) Close() error { return nil } diff --git a/cmd/collector/app/handler/grpc_handler_test.go b/cmd/collector/app/handler/grpc_handler_test.go index ef4f53ee081..289f7ae3aa9 100644 --- a/cmd/collector/app/handler/grpc_handler_test.go +++ b/cmd/collector/app/handler/grpc_handler_test.go @@ -91,7 +91,7 @@ func (p *mockSpanProcessor) reset() { p.spanFormat = "" } -func (p *mockSpanProcessor) Close() error { +func (*mockSpanProcessor) Close() error { return nil } diff --git a/cmd/collector/app/handler/http_thrift_handler_test.go b/cmd/collector/app/handler/http_thrift_handler_test.go index 11c8dc08f4a..cc50ae64b92 100644 --- a/cmd/collector/app/handler/http_thrift_handler_test.go +++ b/cmd/collector/app/handler/http_thrift_handler_test.go @@ -171,7 +171,7 @@ func TestCannotReadBodyFromRequest(t *testing.T) { type errReader struct{} -func (e *errReader) Read(p []byte) (int, error) { +func (*errReader) Read(p []byte) (int, error) { return 0, fmt.Errorf("Simulated error reading body") } @@ -180,7 +180,7 @@ type dummyResponseWriter struct { myStatusCode int } -func (d *dummyResponseWriter) Header() http.Header { +func (*dummyResponseWriter) Header() http.Header { return http.Header{} } diff --git a/cmd/collector/app/handler/thrift_span_handler_test.go b/cmd/collector/app/handler/thrift_span_handler_test.go index 970b137d151..d247f1ab59d 100644 --- a/cmd/collector/app/handler/thrift_span_handler_test.go +++ b/cmd/collector/app/handler/thrift_span_handler_test.go @@ -80,7 +80,7 @@ func (s *shouldIErrorProcessor) ProcessSpans(mSpans []*model.Span, _ processor.S return retMe, nil } -func (s *shouldIErrorProcessor) Close() error { +func (*shouldIErrorProcessor) Close() error { return nil } diff --git a/cmd/collector/app/options.go b/cmd/collector/app/options.go index c25140a4090..477f1296073 100644 --- a/cmd/collector/app/options.go +++ b/cmd/collector/app/options.go @@ -172,7 +172,7 @@ func (options) OnDroppedSpan(onDroppedSpan func(span *model.Span)) Option { } } -func (o options) apply(opts ...Option) options { +func (options) apply(opts ...Option) options { ret := options{} for _, opt := range opts { opt(&ret) diff --git a/cmd/collector/app/sampling/grpc_handler_test.go b/cmd/collector/app/sampling/grpc_handler_test.go index 439e3bef646..ed9a65a72c6 100644 --- a/cmd/collector/app/sampling/grpc_handler_test.go +++ b/cmd/collector/app/sampling/grpc_handler_test.go @@ -28,7 +28,7 @@ import ( type mockSamplingStore struct{} -func (s mockSamplingStore) GetSamplingStrategy(ctx context.Context, serviceName string) (*api_v2.SamplingStrategyResponse, error) { +func (mockSamplingStore) GetSamplingStrategy(ctx context.Context, serviceName string) (*api_v2.SamplingStrategyResponse, error) { if serviceName == "error" { return nil, errors.New("some error") } else if serviceName == "nil" { @@ -37,7 +37,7 @@ func (s mockSamplingStore) GetSamplingStrategy(ctx context.Context, serviceName return &api_v2.SamplingStrategyResponse{StrategyType: api_v2.SamplingStrategyType_PROBABILISTIC}, nil } -func (s mockSamplingStore) Close() error { +func (mockSamplingStore) Close() error { return nil } diff --git a/cmd/collector/app/sanitizer/cache/auto_refresh_cache.go b/cmd/collector/app/sanitizer/cache/auto_refresh_cache.go index 546d1223834..b3d8c433fdd 100644 --- a/cmd/collector/app/sanitizer/cache/auto_refresh_cache.go +++ b/cmd/collector/app/sanitizer/cache/auto_refresh_cache.go @@ -65,7 +65,7 @@ func (c *autoRefreshCache) Get(key string) string { } // Put implementation that does nothing -func (c *autoRefreshCache) Put(key string, value string) error { +func (*autoRefreshCache) Put(key string, value string) error { return nil } diff --git a/cmd/collector/app/sanitizer/service_name_sanitizer_test.go b/cmd/collector/app/sanitizer/service_name_sanitizer_test.go index cb8cfc401b4..f9ab382e300 100644 --- a/cmd/collector/app/sanitizer/service_name_sanitizer_test.go +++ b/cmd/collector/app/sanitizer/service_name_sanitizer_test.go @@ -40,11 +40,11 @@ func (d *fixedMappingCache) Get(key string) string { return k } -func (d *fixedMappingCache) Put(key string, value string) error { +func (*fixedMappingCache) Put(key string, value string) error { return nil } -func (d *fixedMappingCache) Initialize() error { +func (*fixedMappingCache) Initialize() error { return nil } diff --git a/cmd/collector/app/sanitizer/zipkin/span_sanitizer.go b/cmd/collector/app/sanitizer/zipkin/span_sanitizer.go index 8ba8a71f665..82fad02c7d6 100644 --- a/cmd/collector/app/sanitizer/zipkin/span_sanitizer.go +++ b/cmd/collector/app/sanitizer/zipkin/span_sanitizer.go @@ -69,7 +69,7 @@ func NewSpanDurationSanitizer() Sanitizer { type spanDurationSanitizer struct{} -func (s *spanDurationSanitizer) Sanitize(span *zc.Span) *zc.Span { +func (*spanDurationSanitizer) Sanitize(span *zc.Span) *zc.Span { if span.Duration == nil { duration := defaultDuration if len(span.Annotations) >= 2 { @@ -116,7 +116,7 @@ func NewSpanStartTimeSanitizer() Sanitizer { type spanStartTimeSanitizer struct{} -func (s *spanStartTimeSanitizer) Sanitize(span *zc.Span) *zc.Span { +func (*spanStartTimeSanitizer) Sanitize(span *zc.Span) *zc.Span { if span.Timestamp != nil || len(span.Annotations) == 0 { return span } @@ -143,7 +143,7 @@ func NewParentIDSanitizer() Sanitizer { type parentIDSanitizer struct{} -func (s *parentIDSanitizer) Sanitize(span *zc.Span) *zc.Span { +func (*parentIDSanitizer) Sanitize(span *zc.Span) *zc.Span { if span.ParentID == nil || *span.ParentID != 0 { return span } @@ -166,7 +166,7 @@ func NewErrorTagSanitizer() Sanitizer { type errorTagSanitizer struct{} -func (s *errorTagSanitizer) Sanitize(span *zc.Span) *zc.Span { +func (*errorTagSanitizer) Sanitize(span *zc.Span) *zc.Span { for _, binAnno := range span.BinaryAnnotations { if binAnno.AnnotationType != zc.AnnotationType_BOOL && strings.EqualFold("error", binAnno.Key) { binAnno.AnnotationType = zc.AnnotationType_BOOL diff --git a/cmd/collector/app/server/test.go b/cmd/collector/app/server/test.go index b670934a785..38667d9f034 100644 --- a/cmd/collector/app/server/test.go +++ b/cmd/collector/app/server/test.go @@ -24,20 +24,20 @@ import ( type mockSamplingStore struct{} -func (s mockSamplingStore) GetSamplingStrategy(_ context.Context, serviceName string) (*api_v2.SamplingStrategyResponse, error) { +func (mockSamplingStore) GetSamplingStrategy(_ context.Context, serviceName string) (*api_v2.SamplingStrategyResponse, error) { return nil, nil } -func (s mockSamplingStore) Close() error { +func (mockSamplingStore) Close() error { return nil } type mockSpanProcessor struct{} -func (p *mockSpanProcessor) Close() error { +func (*mockSpanProcessor) Close() error { return nil } -func (p *mockSpanProcessor) ProcessSpans(spans []*model.Span, _ processor.SpansOptions) ([]bool, error) { +func (*mockSpanProcessor) ProcessSpans(spans []*model.Span, _ processor.SpansOptions) ([]bool, error) { return []bool{}, nil } diff --git a/cmd/collector/app/span_processor_test.go b/cmd/collector/app/span_processor_test.go index eff4f6d63bb..48550d331eb 100644 --- a/cmd/collector/app/span_processor_test.go +++ b/cmd/collector/app/span_processor_test.go @@ -197,7 +197,7 @@ func (n *fakeSpanWriter) WriteSpan(ctx context.Context, span *model.Span) error return n.err } -func (n *fakeSpanWriter) Close() error { +func (*fakeSpanWriter) Close() error { return nil } diff --git a/cmd/es-index-cleaner/app/flags.go b/cmd/es-index-cleaner/app/flags.go index 53e4d06ea9a..a3a344b8099 100644 --- a/cmd/es-index-cleaner/app/flags.go +++ b/cmd/es-index-cleaner/app/flags.go @@ -43,7 +43,7 @@ type Config struct { } // AddFlags adds flags for TLS to the FlagSet. -func (c *Config) AddFlags(flags *flag.FlagSet) { +func (*Config) AddFlags(flags *flag.FlagSet) { flags.String(indexPrefix, "", "Index prefix") flags.Bool(archive, false, "Whether to remove archive indices. It works only for rollover") flags.Bool(rollover, false, "Whether to remove indices created by rollover") diff --git a/cmd/es-rollover/app/init/flags.go b/cmd/es-rollover/app/init/flags.go index 6b51e1ebce5..7e9ed89dbfe 100644 --- a/cmd/es-rollover/app/init/flags.go +++ b/cmd/es-rollover/app/init/flags.go @@ -43,7 +43,7 @@ type Config struct { } // AddFlags adds flags for TLS to the FlagSet. -func (c *Config) AddFlags(flags *flag.FlagSet) { +func (*Config) AddFlags(flags *flag.FlagSet) { flags.Int(shards, 5, "Number of shards") flags.Int(replicas, 1, "Number of replicas") flags.Int(prioritySpanTemplate, 0, "Priority of jaeger-span index template (ESv8 only)") diff --git a/cmd/es-rollover/app/lookback/flags.go b/cmd/es-rollover/app/lookback/flags.go index b68d03eb898..e7d1b8c2176 100644 --- a/cmd/es-rollover/app/lookback/flags.go +++ b/cmd/es-rollover/app/lookback/flags.go @@ -37,7 +37,7 @@ type Config struct { } // AddFlags adds flags for TLS to the FlagSet. -func (c *Config) AddFlags(flags *flag.FlagSet) { +func (*Config) AddFlags(flags *flag.FlagSet) { flags.String(unit, defaultUnit, "used with lookback to remove indices from read alias e.g, days, weeks, months, years") flags.Int(unitCount, defaultUnitCount, "count of UNITs") } diff --git a/cmd/es-rollover/app/rollover/flags.go b/cmd/es-rollover/app/rollover/flags.go index 2e5cd66144d..3b3d9123bda 100644 --- a/cmd/es-rollover/app/rollover/flags.go +++ b/cmd/es-rollover/app/rollover/flags.go @@ -34,7 +34,7 @@ type Config struct { } // AddFlags adds flags for TLS to the FlagSet. -func (c *Config) AddFlags(flags *flag.FlagSet) { +func (*Config) AddFlags(flags *flag.FlagSet) { flags.String(conditions, defaultRollbackCondition, "conditions used to rollover to a new write index") } diff --git a/cmd/ingester/app/consumer/committing_processor_test.go b/cmd/ingester/app/consumer/committing_processor_test.go index b37f4746b31..71531e8298c 100644 --- a/cmd/ingester/app/consumer/committing_processor_test.go +++ b/cmd/ingester/app/consumer/committing_processor_test.go @@ -65,7 +65,7 @@ func TestNewCommittingProcessorError(t *testing.T) { type fakeProcessorMessage struct{} -func (f fakeProcessorMessage) Value() []byte { +func (fakeProcessorMessage) Value() []byte { return nil } diff --git a/cmd/ingester/app/consumer/processor_factory_test.go b/cmd/ingester/app/consumer/processor_factory_test.go index f64721e8e76..6fd944bc07e 100644 --- a/cmd/ingester/app/consumer/processor_factory_test.go +++ b/cmd/ingester/app/consumer/processor_factory_test.go @@ -91,7 +91,7 @@ func (f *fakeProcessor) Start() { type fakeMsg struct{} -func (f *fakeMsg) Value() []byte { +func (*fakeMsg) Value() []byte { return nil } diff --git a/cmd/ingester/app/processor/decorator/retry_test.go b/cmd/ingester/app/processor/decorator/retry_test.go index c48e923d51d..867ee2e93e0 100644 --- a/cmd/ingester/app/processor/decorator/retry_test.go +++ b/cmd/ingester/app/processor/decorator/retry_test.go @@ -95,7 +95,7 @@ func TestNewRetryingProcessorNoErrorPropagation(t *testing.T) { type fakeRand struct{} -func (f *fakeRand) Int63n(v int64) int64 { +func (*fakeRand) Int63n(v int64) int64 { return v } diff --git a/cmd/jaeger/internal/exporters/storageexporter/exporter.go b/cmd/jaeger/internal/exporters/storageexporter/exporter.go index 68aa330a8f4..70f682f290a 100644 --- a/cmd/jaeger/internal/exporters/storageexporter/exporter.go +++ b/cmd/jaeger/internal/exporters/storageexporter/exporter.go @@ -43,7 +43,7 @@ func (exp *storageExporter) start(_ context.Context, host component.Host) error return nil } -func (exp *storageExporter) close(_ context.Context) error { +func (*storageExporter) close(_ context.Context) error { // span writer is not closable return nil } diff --git a/cmd/jaeger/internal/extension/jaegerquery/server.go b/cmd/jaeger/internal/extension/jaegerquery/server.go index 330ecbb1349..9a07f1089bf 100644 --- a/cmd/jaeger/internal/extension/jaegerquery/server.go +++ b/cmd/jaeger/internal/extension/jaegerquery/server.go @@ -42,7 +42,7 @@ func newServer(config *Config, otel component.TelemetrySettings) *server { } // Dependencies implements extension.Dependent to ensure this always starts after jaegerstorage extension. -func (s *server) Dependencies() []component.ID { +func (*server) Dependencies() []component.ID { return []component.ID{jaegerstorage.ID} } diff --git a/cmd/jaeger/internal/extension/jaegerquery/server_test.go b/cmd/jaeger/internal/extension/jaegerquery/server_test.go index 91a8360fd5d..cbf8d2ceaca 100644 --- a/cmd/jaeger/internal/extension/jaegerquery/server_test.go +++ b/cmd/jaeger/internal/extension/jaegerquery/server_test.go @@ -62,18 +62,18 @@ type fakeStorageExt struct{} var _ jaegerstorage.Extension = (*fakeStorageExt)(nil) -func (fse fakeStorageExt) Factory(name string) (storage.Factory, bool) { +func (fakeStorageExt) Factory(name string) (storage.Factory, bool) { if name == "need-factory-error" { return nil, false } return fakeFactory{name: name}, true } -func (fse fakeStorageExt) Start(ctx context.Context, host component.Host) error { +func (fakeStorageExt) Start(ctx context.Context, host component.Host) error { return nil } -func (fse fakeStorageExt) Shutdown(ctx context.Context) error { +func (fakeStorageExt) Shutdown(ctx context.Context) error { return nil } @@ -81,7 +81,7 @@ type storageHost struct { extension component.Component } -func (host storageHost) ReportFatalError(err error) { +func (storageHost) ReportFatalError(err error) { } func (host storageHost) GetExtensions() map[component.ID]component.Component { diff --git a/cmd/jaeger/internal/extension/jaegerstorage/extension_test.go b/cmd/jaeger/internal/extension/jaegerstorage/extension_test.go index b6b6d1a169e..4a50b002303 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/extension_test.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/extension_test.go @@ -52,19 +52,19 @@ type errorFactory struct { closeErr error } -func (e errorFactory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) error { +func (errorFactory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) error { panic("not implemented") } -func (e errorFactory) CreateSpanReader() (spanstore.Reader, error) { +func (errorFactory) CreateSpanReader() (spanstore.Reader, error) { panic("not implemented") } -func (e errorFactory) CreateSpanWriter() (spanstore.Writer, error) { +func (errorFactory) CreateSpanWriter() (spanstore.Writer, error) { panic("not implemented") } -func (e errorFactory) CreateDependencyReader() (dependencystore.Reader, error) { +func (errorFactory) CreateDependencyReader() (dependencystore.Reader, error) { panic("not implemented") } diff --git a/cmd/jaeger/internal/integration/receivers/storagereceiver/receiver_test.go b/cmd/jaeger/internal/integration/receivers/storagereceiver/receiver_test.go index b71d03d56ea..393d2082e48 100644 --- a/cmd/jaeger/internal/integration/receivers/storagereceiver/receiver_test.go +++ b/cmd/jaeger/internal/integration/receivers/storagereceiver/receiver_test.go @@ -33,11 +33,11 @@ type mockStorageExt struct { factory *factoryMocks.Factory } -func (m *mockStorageExt) Start(ctx context.Context, host component.Host) error { +func (*mockStorageExt) Start(ctx context.Context, host component.Host) error { panic("not implemented") } -func (m *mockStorageExt) Shutdown(ctx context.Context) error { +func (*mockStorageExt) Shutdown(ctx context.Context) error { panic("not implemented") } diff --git a/cmd/jaeger/internal/integration/span_reader.go b/cmd/jaeger/internal/integration/span_reader.go index eb878836133..14db12312b4 100644 --- a/cmd/jaeger/internal/integration/span_reader.go +++ b/cmd/jaeger/internal/integration/span_reader.go @@ -168,6 +168,6 @@ func (r *spanReader) FindTraces(ctx context.Context, query *spanstore.TraceQuery return traces, nil } -func (r *spanReader) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { +func (*spanReader) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { panic("not implemented") } diff --git a/cmd/jaeger/internal/integration/storagecleaner/extension.go b/cmd/jaeger/internal/integration/storagecleaner/extension.go index 288e7248d9e..cdc7b0988c8 100644 --- a/cmd/jaeger/internal/integration/storagecleaner/extension.go +++ b/cmd/jaeger/internal/integration/storagecleaner/extension.go @@ -93,6 +93,6 @@ func (c *storageCleaner) Shutdown(ctx context.Context) error { return nil } -func (c *storageCleaner) Dependencies() []component.ID { +func (*storageCleaner) Dependencies() []component.ID { return []component.ID{jaegerstorage.ID} } diff --git a/cmd/jaeger/internal/integration/storagecleaner/extension_test.go b/cmd/jaeger/internal/integration/storagecleaner/extension_test.go index fd81db9fce5..068a58ed131 100644 --- a/cmd/jaeger/internal/integration/storagecleaner/extension_test.go +++ b/cmd/jaeger/internal/integration/storagecleaner/extension_test.go @@ -40,11 +40,11 @@ type mockStorageExt struct { factory storage.Factory } -func (m *mockStorageExt) Start(ctx context.Context, host component.Host) error { +func (*mockStorageExt) Start(ctx context.Context, host component.Host) error { panic("not implemented") } -func (m *mockStorageExt) Shutdown(ctx context.Context) error { +func (*mockStorageExt) Shutdown(ctx context.Context) error { panic("not implemented") } diff --git a/cmd/query/app/apiv3/gateway_test.go b/cmd/query/app/apiv3/gateway_test.go index 799962388b0..745ea2c643d 100644 --- a/cmd/query/app/apiv3/gateway_test.go +++ b/cmd/query/app/apiv3/gateway_test.go @@ -70,7 +70,7 @@ func (gw *testGateway) execRequest(t *testing.T, url string) ([]byte, int) { return body, response.StatusCode } -func (gw *testGateway) verifySnapshot(t *testing.T, body []byte) []byte { +func (*testGateway) verifySnapshot(t *testing.T, body []byte) []byte { // reformat JSON body with indentation, to make diffing easier var data any require.NoError(t, json.Unmarshal(body, &data), "response: %s", string(body)) diff --git a/cmd/query/app/apiv3/http_gateway.go b/cmd/query/app/apiv3/http_gateway.go index 9bb6535af9d..16f01cbdb10 100644 --- a/cmd/query/app/apiv3/http_gateway.go +++ b/cmd/query/app/apiv3/http_gateway.go @@ -131,7 +131,7 @@ func (h *HTTPGateway) returnSpansTestable( h.marshalResponse(response, w) } -func (h *HTTPGateway) marshalResponse(response proto.Message, w http.ResponseWriter) { +func (*HTTPGateway) marshalResponse(response proto.Message, w http.ResponseWriter) { _ = new(jsonpb.Marshaler).Marshal(w, response) } diff --git a/cmd/query/app/http_handler.go b/cmd/query/app/http_handler.go index a9dc13d7828..5f217118610 100644 --- a/cmd/query/app/http_handler.go +++ b/cmd/query/app/http_handler.go @@ -393,7 +393,7 @@ func (aH *APIHandler) convertModelToUI(trace *model.Trace, adjust bool) (*ui.Tra return uiTrace, uiError } -func (aH *APIHandler) deduplicateDependencies(dependencies []model.DependencyLink) []ui.DependencyLink { +func (*APIHandler) deduplicateDependencies(dependencies []model.DependencyLink) []ui.DependencyLink { type Key struct { parent string child string @@ -412,7 +412,7 @@ func (aH *APIHandler) deduplicateDependencies(dependencies []model.DependencyLin return result } -func (aH *APIHandler) filterDependenciesByService( +func (*APIHandler) filterDependenciesByService( dependencies []model.DependencyLink, service string, ) []model.DependencyLink { diff --git a/cmd/query/app/http_handler_test.go b/cmd/query/app/http_handler_test.go index ef14c6b20a6..00d8dcf87d8 100644 --- a/cmd/query/app/http_handler_test.go +++ b/cmd/query/app/http_handler_test.go @@ -206,11 +206,11 @@ func TestLogOnServerError(t *testing.T) { // httpResponseErrWriter implements the http.ResponseWriter interface that returns an error on Write. type httpResponseErrWriter struct{} -func (h *httpResponseErrWriter) Write([]byte) (int, error) { +func (*httpResponseErrWriter) Write([]byte) (int, error) { return 0, fmt.Errorf("failed to write") } -func (h *httpResponseErrWriter) WriteHeader(statusCode int) {} -func (h *httpResponseErrWriter) Header() http.Header { +func (*httpResponseErrWriter) WriteHeader(statusCode int) {} +func (*httpResponseErrWriter) Header() http.Header { return http.Header{} } diff --git a/cmd/query/app/query_parser.go b/cmd/query/app/query_parser.go index 063db13b801..48b1ad9b146 100644 --- a/cmd/query/app/query_parser.go +++ b/cmd/query/app/query_parser.go @@ -369,7 +369,7 @@ func mapSpanKindsToOpenTelemetry(spanKinds []string) ([]string, error) { return otelSpanKinds, nil } -func (p *queryParser) validateQuery(traceQuery *traceQueryParameters) error { +func (*queryParser) validateQuery(traceQuery *traceQueryParameters) error { if len(traceQuery.traceIDs) == 0 && traceQuery.ServiceName == "" { return errServiceParameterRequired } @@ -381,7 +381,7 @@ func (p *queryParser) validateQuery(traceQuery *traceQueryParameters) error { return nil } -func (p *queryParser) parseTags(simpleTags []string, jsonTags []string) (map[string]string, error) { +func (*queryParser) parseTags(simpleTags []string, jsonTags []string) (map[string]string, error) { retMe := make(map[string]string) for _, tag := range simpleTags { keyAndValue := strings.Split(tag, ":") diff --git a/cmd/query/app/token_propagation_test.go b/cmd/query/app/token_propagation_test.go index 1ae5d5c0ef0..1e9a0ebfea4 100644 --- a/cmd/query/app/token_propagation_test.go +++ b/cmd/query/app/token_propagation_test.go @@ -46,7 +46,7 @@ type elasticsearchHandlerMock struct { test *testing.T } -func (h *elasticsearchHandlerMock) ServeHTTP(w http.ResponseWriter, r *http.Request) { +func (*elasticsearchHandlerMock) ServeHTTP(w http.ResponseWriter, r *http.Request) { if token, ok := bearertoken.GetBearerToken(r.Context()); ok && token == bearerToken { // Return empty results, we don't care about the result here. // we just need to make sure the token was propagated to the storage and the query-service returns 200 diff --git a/crossdock/services/agent_test.go b/crossdock/services/agent_test.go index 2361db09e5b..3ffda9a2568 100644 --- a/crossdock/services/agent_test.go +++ b/crossdock/services/agent_test.go @@ -65,7 +65,7 @@ func TestGetSamplingRateInternal(t *testing.T) { type testAgentHandler struct{} -func (h *testAgentHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { +func (*testAgentHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { svc := r.FormValue("service") body := []byte("bad json") if svc == "crossdock-svc" { diff --git a/crossdock/services/query_test.go b/crossdock/services/query_test.go index 632d9eb9daf..8e92478ed8d 100644 --- a/crossdock/services/query_test.go +++ b/crossdock/services/query_test.go @@ -30,7 +30,7 @@ import ( type testQueryHandler struct{} -func (h *testQueryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { +func (*testQueryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { svc := r.FormValue("service") body := []byte("bad json") if svc == "svc" { diff --git a/crossdock/services/tracehandler.go b/crossdock/services/tracehandler.go index b4e5f36e02e..90f23b94530 100644 --- a/crossdock/services/tracehandler.go +++ b/crossdock/services/tracehandler.go @@ -123,7 +123,7 @@ func (h *TraceHandler) AdaptiveSamplingTest(t crossdock.T) { } } -func (h *TraceHandler) runTest(service string, request *traceRequest, tFunc testFunc, vFunc validateFunc) error { +func (*TraceHandler) runTest(service string, request *traceRequest, tFunc testFunc, vFunc validateFunc) error { traces, err := tFunc(service, request) if err != nil { return err diff --git a/examples/hotrod/pkg/log/spanlogger.go b/examples/hotrod/pkg/log/spanlogger.go index 582e22b1d91..98d0f3fce1a 100644 --- a/examples/hotrod/pkg/log/spanlogger.go +++ b/examples/hotrod/pkg/log/spanlogger.go @@ -172,5 +172,5 @@ func (e *bridgeFieldEncoder) AddUintptr(key string, value uintptr) { e.pairs = append(e.pairs, attribute.String(key, fmt.Sprint(value))) } -func (e *bridgeFieldEncoder) AddReflected(key string, value any) error { return nil } -func (e *bridgeFieldEncoder) OpenNamespace(key string) {} +func (*bridgeFieldEncoder) AddReflected(key string, value any) error { return nil } +func (*bridgeFieldEncoder) OpenNamespace(key string) {} diff --git a/examples/hotrod/pkg/tracing/rpcmetrics/observer.go b/examples/hotrod/pkg/tracing/rpcmetrics/observer.go index 75305974efb..2b14077a10d 100644 --- a/examples/hotrod/pkg/tracing/rpcmetrics/observer.go +++ b/examples/hotrod/pkg/tracing/rpcmetrics/observer.go @@ -48,7 +48,7 @@ func NewObserver(metricsFactory metrics.Factory, normalizer NameNormalizer) *Obs } } -func (o *Observer) OnStart(parent context.Context, s sdktrace.ReadWriteSpan) {} +func (*Observer) OnStart(parent context.Context, s sdktrace.ReadWriteSpan) {} func (o *Observer) OnEnd(sp sdktrace.ReadOnlySpan) { operationName := sp.Name() @@ -83,10 +83,10 @@ func (o *Observer) OnEnd(sp sdktrace.ReadOnlySpan) { } } -func (o *Observer) Shutdown(ctx context.Context) error { +func (*Observer) Shutdown(ctx context.Context) error { return nil } -func (o *Observer) ForceFlush(ctx context.Context) error { +func (*Observer) ForceFlush(ctx context.Context) error { return nil } diff --git a/internal/metrics/prometheus/cache.go b/internal/metrics/prometheus/cache.go index 40791ebb708..d5bf7ec6789 100644 --- a/internal/metrics/prometheus/cache.go +++ b/internal/metrics/prometheus/cache.go @@ -81,6 +81,6 @@ func (c *vectorCache) getOrMakeHistogramVec(opts prometheus.HistogramOpts, label return hv } -func (c *vectorCache) getCacheKey(name string, labels []string) string { +func (*vectorCache) getCacheKey(name string, labels []string) string { return strings.Join(append([]string{name}, labels...), "||") } diff --git a/internal/metrics/prometheus/factory.go b/internal/metrics/prometheus/factory.go index 0f8b3a959d7..bb4a296ce95 100644 --- a/internal/metrics/prometheus/factory.go +++ b/internal/metrics/prometheus/factory.go @@ -280,7 +280,7 @@ func (f *Factory) mergeTags(tags map[string]string) map[string]string { return ret } -func (f *Factory) tagNames(tags map[string]string) []string { +func (*Factory) tagNames(tags map[string]string) []string { ret := make([]string, 0, len(tags)) for k := range tags { ret = append(ret, k) @@ -289,7 +289,7 @@ func (f *Factory) tagNames(tags map[string]string) []string { return ret } -func (f *Factory) tagsAsLabelValues(labels []string, tags map[string]string) []string { +func (*Factory) tagsAsLabelValues(labels []string, tags map[string]string) []string { ret := make([]string, 0, len(tags)) for _, l := range labels { ret = append(ret, tags[l]) diff --git a/model/adjuster/bad_span_references.go b/model/adjuster/bad_span_references.go index 799324e6e14..1fb05fdec9f 100644 --- a/model/adjuster/bad_span_references.go +++ b/model/adjuster/bad_span_references.go @@ -57,6 +57,6 @@ func (s spanReferenceAdjuster) adjust(span *model.Span) *model.Span { return span } -func (s spanReferenceAdjuster) valid(ref *model.SpanRef) bool { +func (spanReferenceAdjuster) valid(ref *model.SpanRef) bool { return ref.TraceID.High != 0 || ref.TraceID.Low != 0 } diff --git a/model/adjuster/clockskew.go b/model/adjuster/clockskew.go index dccc5e8d580..cb656093f7c 100644 --- a/model/adjuster/clockskew.go +++ b/model/adjuster/clockskew.go @@ -149,7 +149,7 @@ func (a *clockSkewAdjuster) adjustNode(n *node, parent *node, skew clockSkew) { } } -func (a *clockSkewAdjuster) calculateSkew(child *node, parent *node) time.Duration { +func (*clockSkewAdjuster) calculateSkew(child *node, parent *node) time.Duration { parentDuration := parent.span.Duration childDuration := child.span.Duration parentEndTime := parent.span.StartTime.Add(parent.span.Duration) diff --git a/model/converter/json/from_domain.go b/model/converter/json/from_domain.go index b5d484741bc..677f96bb386 100644 --- a/model/converter/json/from_domain.go +++ b/model/converter/json/from_domain.go @@ -110,14 +110,14 @@ func (fd fromDomain) convertReferences(span *model.Span) []json.Reference { return out } -func (fd fromDomain) convertRefType(refType model.SpanRefType) json.ReferenceType { +func (fromDomain) convertRefType(refType model.SpanRefType) json.ReferenceType { if refType == model.FollowsFrom { return json.FollowsFrom } return json.ChildOf } -func (fd fromDomain) convertKeyValues(keyValues model.KeyValues) []json.KeyValue { +func (fromDomain) convertKeyValues(keyValues model.KeyValues) []json.KeyValue { out := make([]json.KeyValue, len(keyValues)) for i, kv := range keyValues { var value any @@ -146,7 +146,7 @@ func (fd fromDomain) convertKeyValues(keyValues model.KeyValues) []json.KeyValue return out } -func (fd fromDomain) convertKeyValuesString(keyValues model.KeyValues) []json.KeyValue { +func (fromDomain) convertKeyValuesString(keyValues model.KeyValues) []json.KeyValue { out := make([]json.KeyValue, len(keyValues)) for i, kv := range keyValues { out[i] = json.KeyValue{ diff --git a/model/converter/thrift/jaeger/from_domain.go b/model/converter/thrift/jaeger/from_domain.go index 8ae83e02c57..6f8b85863d9 100644 --- a/model/converter/thrift/jaeger/from_domain.go +++ b/model/converter/thrift/jaeger/from_domain.go @@ -44,7 +44,7 @@ func FromDomainSpan(span *model.Span) *jaeger.Span { type domainToJaegerTransformer struct{} -func (d domainToJaegerTransformer) keyValueToTag(kv *model.KeyValue) *jaeger.Tag { +func (domainToJaegerTransformer) keyValueToTag(kv *model.KeyValue) *jaeger.Tag { if kv.VType == model.StringType { stringValue := kv.VStr return &jaeger.Tag{ @@ -119,7 +119,7 @@ func (d domainToJaegerTransformer) convertLogs(logs []model.Log) []*jaeger.Log { return jaegerLogs } -func (d domainToJaegerTransformer) convertSpanRefs(refs []model.SpanRef) []*jaeger.SpanRef { +func (domainToJaegerTransformer) convertSpanRefs(refs []model.SpanRef) []*jaeger.SpanRef { jaegerSpanRefs := make([]*jaeger.SpanRef, len(refs)) for idx, ref := range refs { jaegerSpanRefs[idx] = &jaeger.SpanRef{ diff --git a/model/converter/thrift/jaeger/to_domain.go b/model/converter/thrift/jaeger/to_domain.go index 2738776123f..5f3838bc397 100644 --- a/model/converter/thrift/jaeger/to_domain.go +++ b/model/converter/thrift/jaeger/to_domain.go @@ -83,7 +83,7 @@ func (td toDomain) transformSpan(jSpan *jaeger.Span, mProcess *model.Process) *m } } -func (td toDomain) getReferences(jRefs []*jaeger.SpanRef) []model.SpanRef { +func (toDomain) getReferences(jRefs []*jaeger.SpanRef) []model.SpanRef { if len(jRefs) == 0 { return nil } @@ -127,7 +127,7 @@ func (td toDomain) getTags(tags []*jaeger.Tag, extraSpace int) model.KeyValues { return retMe } -func (td toDomain) getTag(tag *jaeger.Tag) model.KeyValue { +func (toDomain) getTag(tag *jaeger.Tag) model.KeyValue { switch tag.VType { case jaeger.TagType_BOOL: return model.Bool(tag.Key, tag.GetVBool()) diff --git a/model/converter/thrift/zipkin/to_domain.go b/model/converter/thrift/zipkin/to_domain.go index d0cc39d87cb..3e0730a09dc 100644 --- a/model/converter/thrift/zipkin/to_domain.go +++ b/model/converter/thrift/zipkin/to_domain.go @@ -116,7 +116,7 @@ func (td toDomain) ToDomainSpans(zSpan *zipkincore.Span) ([]*model.Span, error) return jSpans, err } -func (td toDomain) findAnnotation(zSpan *zipkincore.Span, value string) *zipkincore.Annotation { +func (toDomain) findAnnotation(zSpan *zipkincore.Span, value string) *zipkincore.Annotation { for _, ann := range zSpan.Annotations { if ann.Value == value { return ann @@ -189,7 +189,7 @@ func (td toDomain) transformSpan(zSpan *zipkincore.Span) []*model.Span { } // getFlags takes a Zipkin Span and deduces the proper flags settings -func (td toDomain) getFlags(zSpan *zipkincore.Span) model.Flags { +func (toDomain) getFlags(zSpan *zipkincore.Span) model.Flags { f := model.Flags(0) if zSpan.Debug { f.SetDebug() @@ -265,12 +265,12 @@ func (td toDomain) findServiceNameAndIP(zSpan *zipkincore.Span) (string, int32, return UnknownServiceName, 0, err } -func (td toDomain) isCoreAnnotation(annotation *zipkincore.Annotation) bool { +func (toDomain) isCoreAnnotation(annotation *zipkincore.Annotation) bool { _, ok := coreAnnotations[annotation.Value] return ok } -func (td toDomain) isProcessTag(binaryAnnotation *zipkincore.BinaryAnnotation) bool { +func (toDomain) isProcessTag(binaryAnnotation *zipkincore.BinaryAnnotation) bool { _, ok := processTagAnnotations[binaryAnnotation.Key] return ok } @@ -309,7 +309,7 @@ func (td toDomain) getTags(binAnnotations []*zipkincore.BinaryAnnotation, tagInc return retMe } -func (td toDomain) transformBinaryAnnotation(binaryAnnotation *zipkincore.BinaryAnnotation) (model.KeyValue, error) { +func (toDomain) transformBinaryAnnotation(binaryAnnotation *zipkincore.BinaryAnnotation) (model.KeyValue, error) { switch binaryAnnotation.AnnotationType { case zipkincore.AnnotationType_BOOL: vBool := bytes.Equal(binaryAnnotation.Value, trueByteSlice) @@ -372,7 +372,7 @@ func (td toDomain) getLogs(annotations []*zipkincore.Annotation) []model.Log { return retMe } -func (td toDomain) getLogFields(annotation *zipkincore.Annotation) []model.KeyValue { +func (toDomain) getLogFields(annotation *zipkincore.Annotation) []model.KeyValue { var logFields map[string]string // Since Zipkin format does not support kv-logging, some clients encode those Logs // as annotations with JSON value. Therefore, we try JSON decoding first. @@ -388,7 +388,7 @@ func (td toDomain) getLogFields(annotation *zipkincore.Annotation) []model.KeyVa return []model.KeyValue{model.String(DefaultLogFieldKey, annotation.Value)} } -func (td toDomain) getSpanKindTag(annotations []*zipkincore.Annotation) (model.KeyValue, bool) { +func (toDomain) getSpanKindTag(annotations []*zipkincore.Annotation) (model.KeyValue, bool) { for _, a := range annotations { if spanKind, ok := coreAnnotations[a.Value]; ok { return model.String(keySpanKind, spanKind), true @@ -397,7 +397,7 @@ func (td toDomain) getSpanKindTag(annotations []*zipkincore.Annotation) (model.K return model.KeyValue{}, false } -func (td toDomain) getPeerTags(endpoint *zipkincore.Endpoint, tags []model.KeyValue) []model.KeyValue { +func (toDomain) getPeerTags(endpoint *zipkincore.Endpoint, tags []model.KeyValue) []model.KeyValue { if endpoint == nil { return tags } diff --git a/model/ids.go b/model/ids.go index dfdc9070574..3ffd6412e5e 100644 --- a/model/ids.go +++ b/model/ids.go @@ -93,17 +93,17 @@ func TraceIDFromBytes(data []byte) (TraceID, error) { } // MarshalText is called by encoding/json, which we do not want people to use. -func (t TraceID) MarshalText() ([]byte, error) { +func (TraceID) MarshalText() ([]byte, error) { return nil, fmt.Errorf("unsupported method TraceID.MarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling") } // UnmarshalText is called by encoding/json, which we do not want people to use. -func (t *TraceID) UnmarshalText(text []byte) error { +func (*TraceID) UnmarshalText(text []byte) error { return fmt.Errorf("unsupported method TraceID.UnmarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling") } // Size returns the size of this datum in protobuf. It is always 16 bytes. -func (t *TraceID) Size() int { +func (*TraceID) Size() int { return 16 } @@ -187,17 +187,17 @@ func SpanIDFromBytes(data []byte) (SpanID, error) { } // MarshalText is called by encoding/json, which we do not want people to use. -func (s SpanID) MarshalText() ([]byte, error) { +func (SpanID) MarshalText() ([]byte, error) { return nil, fmt.Errorf("unsupported method SpanID.MarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling") } // UnmarshalText is called by encoding/json, which we do not want people to use. -func (s *SpanID) UnmarshalText(text []byte) error { +func (*SpanID) UnmarshalText(text []byte) error { return fmt.Errorf("unsupported method SpanID.UnmarshalText; please use github.com/gogo/protobuf/jsonpb for marshalling") } // Size returns the size of this datum in protobuf. It is always 8 bytes. -func (s *SpanID) Size() int { +func (*SpanID) Size() int { return 8 } diff --git a/pkg/cassandra/metrics/table_test.go b/pkg/cassandra/metrics/table_test.go index 241aa4dcdfb..dab69b1b2ec 100644 --- a/pkg/cassandra/metrics/table_test.go +++ b/pkg/cassandra/metrics/table_test.go @@ -155,7 +155,7 @@ func (q insertQuery) String() string { return q.str } -func (q insertQuery) ScanCAS(dest ...any) (bool, error) { +func (insertQuery) ScanCAS(dest ...any) (bool, error) { return true, nil } diff --git a/pkg/clientcfg/clientcfghttp/cfgmgr_test.go b/pkg/clientcfg/clientcfghttp/cfgmgr_test.go index 7c24bbeda24..c5a7e2a9971 100644 --- a/pkg/clientcfg/clientcfghttp/cfgmgr_test.go +++ b/pkg/clientcfg/clientcfghttp/cfgmgr_test.go @@ -37,7 +37,7 @@ func (m *mockSamplingStore) GetSamplingStrategy(_ context.Context, serviceName s return m.samplingResponse, nil } -func (m *mockSamplingStore) Close() error { +func (*mockSamplingStore) Close() error { return nil } diff --git a/pkg/clientcfg/clientcfghttp/handler.go b/pkg/clientcfg/clientcfghttp/handler.go index 2c7bbc12f09..ab2cef08c5d 100644 --- a/pkg/clientcfg/clientcfghttp/handler.go +++ b/pkg/clientcfg/clientcfghttp/handler.go @@ -213,7 +213,7 @@ var samplingStrategyTypes = []api_v2.SamplingStrategyType{ // // Thrift 0.9.3 classes generate this JSON: // {"strategyType":"PROBABILISTIC","probabilisticSampling":{"samplingRate":0.5}} -func (h *HTTPHandler) encodeThriftEnums092(json []byte) []byte { +func (*HTTPHandler) encodeThriftEnums092(json []byte) []byte { str := string(json) for _, strategyType := range samplingStrategyTypes { str = strings.Replace( diff --git a/pkg/clientcfg/clientcfghttp/handler_test.go b/pkg/clientcfg/clientcfghttp/handler_test.go index 8b346efb4f7..e08293b1d37 100644 --- a/pkg/clientcfg/clientcfghttp/handler_test.go +++ b/pkg/clientcfg/clientcfghttp/handler_test.go @@ -304,8 +304,8 @@ func (w *mockWriter) Header() http.Header { return w.header } -func (w *mockWriter) Write([]byte) (int, error) { +func (*mockWriter) Write([]byte) (int, error) { return 0, errors.New("write error") } -func (w *mockWriter) WriteHeader(int) {} +func (*mockWriter) WriteHeader(int) {} diff --git a/pkg/config/string_slice.go b/pkg/config/string_slice.go index c38ff826123..8090d643c59 100644 --- a/pkg/config/string_slice.go +++ b/pkg/config/string_slice.go @@ -38,7 +38,7 @@ func (l *StringSlice) Set(value string) error { } // Type implements pflag.Value -func (l *StringSlice) Type() string { +func (*StringSlice) Type() string { // this type string needs to match pflag.stringSliceValue's Type return "stringSlice" } diff --git a/pkg/discovery/grpcresolver/grpc_resolver.go b/pkg/discovery/grpcresolver/grpc_resolver.go index 2329870f7ca..852da1032ba 100644 --- a/pkg/discovery/grpcresolver/grpc_resolver.go +++ b/pkg/discovery/grpcresolver/grpc_resolver.go @@ -106,7 +106,7 @@ func (r *Resolver) Scheme() string { // ResolveNow is a noop for Resolver since resolver is already firing r.cc.UpdatesState every time // it receives updates of new instance from discoCh -func (r *Resolver) ResolveNow(o resolver.ResolveNowOptions) {} +func (*Resolver) ResolveNow(o resolver.ResolveNowOptions) {} func (r *Resolver) watcher() { defer r.closing.Done() diff --git a/pkg/discovery/grpcresolver/grpc_resolver_test.go b/pkg/discovery/grpcresolver/grpc_resolver_test.go index 111798548fd..5488508fcfd 100644 --- a/pkg/discovery/grpcresolver/grpc_resolver_test.go +++ b/pkg/discovery/grpcresolver/grpc_resolver_test.go @@ -44,7 +44,7 @@ type test struct { addresses []string } -func (s *testServer) EmptyCall(ctx context.Context, in *grpc_testing.Empty) (*grpc_testing.Empty, error) { +func (*testServer) EmptyCall(ctx context.Context, in *grpc_testing.Empty) (*grpc_testing.Empty, error) { return &grpc_testing.Empty{}, nil } diff --git a/pkg/es/client/client.go b/pkg/es/client/client.go index ad46cf15077..b121af699c0 100644 --- a/pkg/es/client/client.go +++ b/pkg/es/client/client.go @@ -107,7 +107,7 @@ func (c *Client) setAuthorization(r *http.Request) { } } -func (c *Client) handleFailedRequest(res *http.Response) error { +func (*Client) handleFailedRequest(res *http.Response) error { if res.Body != nil { bodyBytes, err := io.ReadAll(res.Body) if err != nil { diff --git a/pkg/es/client/index_client.go b/pkg/es/client/index_client.go index f55c13070c2..99e4255c6d0 100644 --- a/pkg/es/client/index_client.go +++ b/pkg/es/client/index_client.go @@ -195,7 +195,7 @@ func (i *IndicesClient) DeleteAlias(aliases []Alias) error { return nil } -func (i *IndicesClient) aliasesString(aliases []Alias) string { +func (*IndicesClient) aliasesString(aliases []Alias) string { concatAliases := "" for _, alias := range aliases { concatAliases += fmt.Sprintf("[index: %s, alias: %s],", alias.Index, alias.Name) diff --git a/pkg/es/textTemplate.go b/pkg/es/textTemplate.go index f932731d9a8..b0c6b7d58dc 100644 --- a/pkg/es/textTemplate.go +++ b/pkg/es/textTemplate.go @@ -34,6 +34,6 @@ type TemplateBuilder interface { type TextTemplateBuilder struct{} // Parse is a wrapper for template.Parse -func (t TextTemplateBuilder) Parse(tmpl string) (TemplateApplier, error) { +func (TextTemplateBuilder) Parse(tmpl string) (TemplateApplier, error) { return template.New("mapping").Parse(tmpl) } diff --git a/pkg/gogocodec/codec.go b/pkg/gogocodec/codec.go index 946db0e3ad4..f72de1d9f27 100644 --- a/pkg/gogocodec/codec.go +++ b/pkg/gogocodec/codec.go @@ -61,12 +61,12 @@ func newCodec() *gogoCodec { } // Name implements encoding.Codec -func (c *gogoCodec) Name() string { +func (*gogoCodec) Name() string { return proto.Name } // Marshal implements encoding.Codec -func (c *gogoCodec) Marshal(v any) ([]byte, error) { +func (*gogoCodec) Marshal(v any) ([]byte, error) { t := reflect.TypeOf(v) elem := t.Elem() // use gogo proto only for Jaeger types @@ -77,7 +77,7 @@ func (c *gogoCodec) Marshal(v any) ([]byte, error) { } // Unmarshal implements encoding.Codec -func (c *gogoCodec) Unmarshal(data []byte, v any) error { +func (*gogoCodec) Unmarshal(data []byte, v any) error { t := reflect.TypeOf(v) elem := t.Elem() // only for collections // use gogo proto only for Jaeger types diff --git a/pkg/gzipfs/gzip.go b/pkg/gzipfs/gzip.go index 1a75795cb77..94b9ccb6c91 100644 --- a/pkg/gzipfs/gzip.go +++ b/pkg/gzipfs/gzip.go @@ -80,7 +80,7 @@ func (fi fileInfo) ModTime() time.Time { return fi.info.ModTime() } func (fi fileInfo) IsDir() bool { return fi.info.IsDir() } -func (fi fileInfo) Sys() any { return nil } +func (fileInfo) Sys() any { return nil } // New wraps underlying fs that is expected to contain gzipped files // and presents an unzipped view of it. diff --git a/pkg/healthcheck/handler.go b/pkg/healthcheck/handler.go index 1a714ea70c6..b1860fa2349 100644 --- a/pkg/healthcheck/handler.go +++ b/pkg/healthcheck/handler.go @@ -106,7 +106,7 @@ func (hc *HealthCheck) Handler() http.Handler { }) } -func (hc *HealthCheck) createRespBody(state state, template healthCheckResponse) []byte { +func (*HealthCheck) createRespBody(state state, template healthCheckResponse) []byte { resp := template // clone if state.status == Ready { resp.UpSince = state.upSince diff --git a/pkg/netutils/port_test.go b/pkg/netutils/port_test.go index 9c765540644..6ab6c28436b 100644 --- a/pkg/netutils/port_test.go +++ b/pkg/netutils/port_test.go @@ -27,7 +27,7 @@ type testAddr struct { Address string } -func (tA *testAddr) Network() string { +func (*testAddr) Network() string { return "tcp" } diff --git a/plugin/metrics/disabled/factory.go b/plugin/metrics/disabled/factory.go index ea3a4975340..48ca5de3e2f 100644 --- a/plugin/metrics/disabled/factory.go +++ b/plugin/metrics/disabled/factory.go @@ -35,17 +35,17 @@ func NewFactory() *Factory { } // AddFlags implements plugin.Configurable. -func (f *Factory) AddFlags(_ *flag.FlagSet) {} +func (*Factory) AddFlags(_ *flag.FlagSet) {} // InitFromViper implements plugin.Configurable. -func (f *Factory) InitFromViper(_ *viper.Viper, _ *zap.Logger) {} +func (*Factory) InitFromViper(_ *viper.Viper, _ *zap.Logger) {} // Initialize implements storage.MetricsFactory. -func (f *Factory) Initialize(_ *zap.Logger) error { +func (*Factory) Initialize(_ *zap.Logger) error { return nil } // CreateMetricsReader implements storage.MetricsFactory. -func (f *Factory) CreateMetricsReader() (metricsstore.Reader, error) { +func (*Factory) CreateMetricsReader() (metricsstore.Reader, error) { return NewMetricsReader() } diff --git a/plugin/metrics/disabled/reader.go b/plugin/metrics/disabled/reader.go index c377eeb964e..8b104b84c5b 100644 --- a/plugin/metrics/disabled/reader.go +++ b/plugin/metrics/disabled/reader.go @@ -34,7 +34,7 @@ type ( // ErrDisabled is the error returned by a "disabled" MetricsQueryService on all of its endpoints. var ErrDisabled = &errMetricsQueryDisabledError{} -func (m *errMetricsQueryDisabledError) Error() string { +func (*errMetricsQueryDisabledError) Error() string { return "metrics querying is currently disabled" } @@ -44,21 +44,21 @@ func NewMetricsReader() (*MetricsReader, error) { } // GetLatencies gets the latency metrics for the given set of latency query parameters. -func (m *MetricsReader) GetLatencies(ctx context.Context, requestParams *metricsstore.LatenciesQueryParameters) (*metrics.MetricFamily, error) { +func (*MetricsReader) GetLatencies(ctx context.Context, requestParams *metricsstore.LatenciesQueryParameters) (*metrics.MetricFamily, error) { return nil, ErrDisabled } // GetCallRates gets the call rate metrics for the given set of call rate query parameters. -func (m *MetricsReader) GetCallRates(ctx context.Context, requestParams *metricsstore.CallRateQueryParameters) (*metrics.MetricFamily, error) { +func (*MetricsReader) GetCallRates(ctx context.Context, requestParams *metricsstore.CallRateQueryParameters) (*metrics.MetricFamily, error) { return nil, ErrDisabled } // GetErrorRates gets the error rate metrics for the given set of error rate query parameters. -func (m *MetricsReader) GetErrorRates(ctx context.Context, requestParams *metricsstore.ErrorRateQueryParameters) (*metrics.MetricFamily, error) { +func (*MetricsReader) GetErrorRates(ctx context.Context, requestParams *metricsstore.ErrorRateQueryParameters) (*metrics.MetricFamily, error) { return nil, ErrDisabled } // GetMinStepDuration gets the minimum step duration (the smallest possible duration between two data points in a time series) supported. -func (m *MetricsReader) GetMinStepDuration(_ context.Context, _ *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { +func (*MetricsReader) GetMinStepDuration(_ context.Context, _ *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { return 0, ErrDisabled } diff --git a/plugin/metrics/factory.go b/plugin/metrics/factory.go index a9f8e23fc59..48b54bc7866 100644 --- a/plugin/metrics/factory.go +++ b/plugin/metrics/factory.go @@ -63,7 +63,7 @@ func NewFactory(config FactoryConfig) (*Factory, error) { return f, nil } -func (f *Factory) getFactoryOfType(factoryType string) (storage.MetricsFactory, error) { +func (*Factory) getFactoryOfType(factoryType string) (storage.MetricsFactory, error) { switch factoryType { case prometheusStorageType: return prometheus.NewFactory(), nil diff --git a/plugin/metrics/prometheus/metricsstore/reader.go b/plugin/metrics/prometheus/metricsstore/reader.go index 0934563614e..fc86bd02019 100644 --- a/plugin/metrics/prometheus/metricsstore/reader.go +++ b/plugin/metrics/prometheus/metricsstore/reader.go @@ -246,7 +246,7 @@ func (m MetricsReader) GetErrorRates(ctx context.Context, requestParams *metrics } // GetMinStepDuration gets the minimum step duration (the smallest possible duration between two data points in a time series) supported. -func (m MetricsReader) GetMinStepDuration(_ context.Context, _ *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { +func (MetricsReader) GetMinStepDuration(_ context.Context, _ *metricsstore.MinStepDurationQueryParameters) (time.Duration, error) { return minStep, nil } diff --git a/plugin/sampling/strategystore/adaptive/factory.go b/plugin/sampling/strategystore/adaptive/factory.go index ef875e2dcee..35a583d4800 100644 --- a/plugin/sampling/strategystore/adaptive/factory.go +++ b/plugin/sampling/strategystore/adaptive/factory.go @@ -54,7 +54,7 @@ func NewFactory() *Factory { } // AddFlags implements plugin.Configurable -func (f *Factory) AddFlags(flagSet *flag.FlagSet) { +func (*Factory) AddFlags(flagSet *flag.FlagSet) { AddFlags(flagSet) } diff --git a/plugin/sampling/strategystore/adaptive/processor.go b/plugin/sampling/strategystore/adaptive/processor.go index b62be138249..4a56966d777 100644 --- a/plugin/sampling/strategystore/adaptive/processor.go +++ b/plugin/sampling/strategystore/adaptive/processor.go @@ -269,7 +269,7 @@ func (p *PostAggregator) prependThroughputBucket(bucket *throughputBucket) { // aggregateThroughput aggregates operation throughput from different buckets into one. // All input buckets represent a single time range, but there are many of them because // they are all independently generated by different collector instances from inbound span traffic. -func (p *PostAggregator) aggregateThroughput(throughputs []*model.Throughput) serviceOperationThroughput { +func (*PostAggregator) aggregateThroughput(throughputs []*model.Throughput) serviceOperationThroughput { aggregatedThroughput := make(serviceOperationThroughput) for _, throughput := range throughputs { service := throughput.Service diff --git a/plugin/sampling/strategystore/factory.go b/plugin/sampling/strategystore/factory.go index d1506ed712d..d7fe77b2710 100644 --- a/plugin/sampling/strategystore/factory.go +++ b/plugin/sampling/strategystore/factory.go @@ -67,7 +67,7 @@ func NewFactory(config FactoryConfig) (*Factory, error) { return f, nil } -func (f *Factory) getFactoryOfType(factoryType Kind) (strategystore.Factory, error) { +func (*Factory) getFactoryOfType(factoryType Kind) (strategystore.Factory, error) { switch factoryType { case samplingTypeFile: return static.NewFactory(), nil diff --git a/plugin/sampling/strategystore/factory_test.go b/plugin/sampling/strategystore/factory_test.go index 75493a10b9e..28e8f47182d 100644 --- a/plugin/sampling/strategystore/factory_test.go +++ b/plugin/sampling/strategystore/factory_test.go @@ -155,10 +155,10 @@ func (f *mockFactory) Close() error { type mockSamplingStoreFactory struct{} -func (m *mockSamplingStoreFactory) CreateLock() (distributedlock.Lock, error) { +func (*mockSamplingStoreFactory) CreateLock() (distributedlock.Lock, error) { return nil, nil } -func (m *mockSamplingStoreFactory) CreateSamplingStore(maxBuckets int) (samplingstore.Store, error) { +func (*mockSamplingStoreFactory) CreateSamplingStore(maxBuckets int) (samplingstore.Store, error) { return nil, nil } diff --git a/plugin/sampling/strategystore/static/factory.go b/plugin/sampling/strategystore/static/factory.go index 16097860b6c..d2fb0a8d8a9 100644 --- a/plugin/sampling/strategystore/static/factory.go +++ b/plugin/sampling/strategystore/static/factory.go @@ -43,7 +43,7 @@ func NewFactory() *Factory { } // AddFlags implements plugin.Configurable -func (f *Factory) AddFlags(flagSet *flag.FlagSet) { +func (*Factory) AddFlags(flagSet *flag.FlagSet) { AddFlags(flagSet) } @@ -69,6 +69,6 @@ func (f *Factory) CreateStrategyStore() (strategystore.StrategyStore, strategyst } // Close closes the factory. -func (f *Factory) Close() error { +func (*Factory) Close() error { return nil } diff --git a/plugin/storage/badger/factory.go b/plugin/storage/badger/factory.go index 6ff69142741..5e223625efa 100644 --- a/plugin/storage/badger/factory.go +++ b/plugin/storage/badger/factory.go @@ -204,7 +204,7 @@ func (f *Factory) CreateSamplingStore(maxBuckets int) (samplingstore.Store, erro } // CreateLock implements storage.SamplingStoreFactory -func (f *Factory) CreateLock() (distributedlock.Lock, error) { +func (*Factory) CreateLock() (distributedlock.Lock, error) { return &lock{}, nil } diff --git a/plugin/storage/badger/lock.go b/plugin/storage/badger/lock.go index 036448f1965..dc86669cf4e 100644 --- a/plugin/storage/badger/lock.go +++ b/plugin/storage/badger/lock.go @@ -19,11 +19,11 @@ import "time" type lock struct{} // Acquire always returns true for badgerdb as no lock is needed -func (l *lock) Acquire(resource string, ttl time.Duration) (bool, error) { +func (*lock) Acquire(resource string, ttl time.Duration) (bool, error) { return true, nil } // Forfeit always returns true for badgerdb as no lock is needed -func (l *lock) Forfeit(resource string) (bool, error) { +func (*lock) Forfeit(resource string) (bool, error) { return true, nil } diff --git a/plugin/storage/badger/samplingstore/storage.go b/plugin/storage/badger/samplingstore/storage.go index 0a07b15457f..8ff4fd8d812 100644 --- a/plugin/storage/badger/samplingstore/storage.go +++ b/plugin/storage/badger/samplingstore/storage.go @@ -178,7 +178,7 @@ func (s *SamplingStore) createProbabilitiesEntry(hostname string, probabilities return e, nil } -func (s *SamplingStore) createProbabilitiesKV(hostname string, probabilities model.ServiceOperationProbabilities, qps model.ServiceOperationQPS, startTime uint64) ([]byte, []byte, error) { +func (*SamplingStore) createProbabilitiesKV(hostname string, probabilities model.ServiceOperationProbabilities, qps model.ServiceOperationQPS, startTime uint64) ([]byte, []byte, error) { key := make([]byte, 16) key[0] = probabilitiesKeyPrefix pos := 1 @@ -206,14 +206,14 @@ func (s *SamplingStore) createThroughputEntry(throughput []*model.Throughput, st return e, nil } -func (s *SamplingStore) createBadgerEntry(key []byte, value []byte) *badger.Entry { +func (*SamplingStore) createBadgerEntry(key []byte, value []byte) *badger.Entry { return &badger.Entry{ Key: key, Value: value, } } -func (s *SamplingStore) createThroughputKV(throughput []*model.Throughput, startTime uint64) ([]byte, []byte, error) { +func (*SamplingStore) createThroughputKV(throughput []*model.Throughput, startTime uint64) ([]byte, []byte, error) { key := make([]byte, 16) key[0] = throughputKeyPrefix pos := 1 diff --git a/plugin/storage/badger/spanstore/writer.go b/plugin/storage/badger/spanstore/writer.go index cd9aa56e19c..0265e6c1e38 100644 --- a/plugin/storage/badger/spanstore/writer.go +++ b/plugin/storage/badger/spanstore/writer.go @@ -138,7 +138,7 @@ func createIndexKey(indexPrefixKey byte, value []byte, startTime uint64, traceID return key } -func (w *SpanWriter) createBadgerEntry(key []byte, value []byte, expireTime uint64) *badger.Entry { +func (*SpanWriter) createBadgerEntry(key []byte, value []byte, expireTime uint64) *badger.Entry { return &badger.Entry{ Key: key, Value: value, diff --git a/plugin/storage/blackhole/blackhole.go b/plugin/storage/blackhole/blackhole.go index 3118a2d84ef..924203527db 100644 --- a/plugin/storage/blackhole/blackhole.go +++ b/plugin/storage/blackhole/blackhole.go @@ -37,27 +37,27 @@ func NewStore() *Store { } // GetDependencies returns nothing. -func (st *Store) GetDependencies(ctx context.Context, endTs time.Time, lookback time.Duration) ([]model.DependencyLink, error) { +func (*Store) GetDependencies(ctx context.Context, endTs time.Time, lookback time.Duration) ([]model.DependencyLink, error) { return []model.DependencyLink{}, nil } // WriteSpan writes the given span to blackhole. -func (st *Store) WriteSpan(ctx context.Context, span *model.Span) error { +func (*Store) WriteSpan(ctx context.Context, span *model.Span) error { return nil } // GetTrace gets nothing. -func (st *Store) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) { +func (*Store) GetTrace(ctx context.Context, traceID model.TraceID) (*model.Trace, error) { return nil, spanstore.ErrTraceNotFound } // GetServices returns nothing. -func (st *Store) GetServices(ctx context.Context) ([]string, error) { +func (*Store) GetServices(ctx context.Context) ([]string, error) { return []string{}, nil } // GetOperations returns nothing. -func (st *Store) GetOperations( +func (*Store) GetOperations( ctx context.Context, query spanstore.OperationQueryParameters, ) ([]spanstore.Operation, error) { @@ -65,11 +65,11 @@ func (st *Store) GetOperations( } // FindTraces returns nothing. -func (st *Store) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error) { +func (*Store) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error) { return []*model.Trace{}, nil } // FindTraceIDs returns nothing. -func (m *Store) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { +func (*Store) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { return []model.TraceID{}, nil } diff --git a/plugin/storage/cassandra/spanstore/dbmodel/converter.go b/plugin/storage/cassandra/spanstore/dbmodel/converter.go index ed4a975aaf1..3622d345904 100644 --- a/plugin/storage/cassandra/spanstore/dbmodel/converter.go +++ b/plugin/storage/cassandra/spanstore/dbmodel/converter.go @@ -155,7 +155,7 @@ func (c converter) fromDBWarnings(tags []KeyValue) ([]string, error) { return retMe, nil } -func (c converter) fromDBTag(tag *KeyValue) (model.KeyValue, error) { +func (converter) fromDBTag(tag *KeyValue) (model.KeyValue, error) { switch tag.ValueType { case stringType: return model.String(tag.Key, tag.ValueString), nil @@ -186,7 +186,7 @@ func (c converter) fromDBLogs(logs []Log) ([]model.Log, error) { return retMe, nil } -func (c converter) fromDBRefs(refs []SpanRef) ([]model.SpanRef, error) { +func (converter) fromDBRefs(refs []SpanRef) ([]model.SpanRef, error) { retMe := make([]model.SpanRef, len(refs)) for i, r := range refs { refType, ok := dbToDomainRefMap[r.RefType] @@ -213,7 +213,7 @@ func (c converter) fromDBProcess(process Process) (*model.Process, error) { }, nil } -func (c converter) toDBTags(tags []model.KeyValue) []KeyValue { +func (converter) toDBTags(tags []model.KeyValue) []KeyValue { retMe := make([]KeyValue, len(tags)) for i, t := range tags { // do we want to validate a jaeger tag here? Making sure that the type and value matches up? @@ -230,7 +230,7 @@ func (c converter) toDBTags(tags []model.KeyValue) []KeyValue { return retMe } -func (c converter) toDBWarnings(warnings []string) []KeyValue { +func (converter) toDBWarnings(warnings []string) []KeyValue { retMe := make([]KeyValue, len(warnings)) for i, w := range warnings { kv := model.String(fmt.Sprintf("%s%d", warningStringPrefix, i+1), w) @@ -254,7 +254,7 @@ func (c converter) toDBLogs(logs []model.Log) []Log { return retMe } -func (c converter) toDBRefs(refs []model.SpanRef) []SpanRef { +func (converter) toDBRefs(refs []model.SpanRef) []SpanRef { retMe := make([]SpanRef, len(refs)) for i, r := range refs { retMe[i] = SpanRef{ diff --git a/plugin/storage/cassandra/spanstore/dbmodel/tag_filter.go b/plugin/storage/cassandra/spanstore/dbmodel/tag_filter.go index 58c3108c214..bb8749972d5 100644 --- a/plugin/storage/cassandra/spanstore/dbmodel/tag_filter.go +++ b/plugin/storage/cassandra/spanstore/dbmodel/tag_filter.go @@ -63,14 +63,14 @@ var DefaultTagFilter = tagFilterImpl{} type tagFilterImpl struct{} -func (f tagFilterImpl) FilterProcessTags(span *model.Span, processTags model.KeyValues) model.KeyValues { +func (tagFilterImpl) FilterProcessTags(span *model.Span, processTags model.KeyValues) model.KeyValues { return processTags } -func (f tagFilterImpl) FilterTags(span *model.Span, tags model.KeyValues) model.KeyValues { +func (tagFilterImpl) FilterTags(span *model.Span, tags model.KeyValues) model.KeyValues { return tags } -func (f tagFilterImpl) FilterLogFields(span *model.Span, logFields model.KeyValues) model.KeyValues { +func (tagFilterImpl) FilterLogFields(span *model.Span, logFields model.KeyValues) model.KeyValues { return logFields } diff --git a/plugin/storage/cassandra/spanstore/dbmodel/tag_filter_test.go b/plugin/storage/cassandra/spanstore/dbmodel/tag_filter_test.go index d284dfe1c7a..e9c872f9eb3 100644 --- a/plugin/storage/cassandra/spanstore/dbmodel/tag_filter_test.go +++ b/plugin/storage/cassandra/spanstore/dbmodel/tag_filter_test.go @@ -37,7 +37,7 @@ func TestDefaultTagFilter(t *testing.T) { type onlyStringsFilter struct{} -func (f onlyStringsFilter) filterStringTags(tags model.KeyValues) model.KeyValues { +func (onlyStringsFilter) filterStringTags(tags model.KeyValues) model.KeyValues { var ret model.KeyValues for _, tag := range tags { if tag.VType == model.StringType { diff --git a/plugin/storage/cassandra/spanstore/writer.go b/plugin/storage/cassandra/spanstore/writer.go index 3dfca1fbd76..615dfcedbc3 100644 --- a/plugin/storage/cassandra/spanstore/writer.go +++ b/plugin/storage/cassandra/spanstore/writer.go @@ -264,7 +264,7 @@ func (s *SpanWriter) indexByOperation(span *dbmodel.Span) error { } // shouldIndexTag checks to see if the tag is json or not, if it's UTF8 valid and it's not too large -func (s *SpanWriter) shouldIndexTag(tag dbmodel.TagInsertion) bool { +func (*SpanWriter) shouldIndexTag(tag dbmodel.TagInsertion) bool { isJSON := func(s string) bool { var js json.RawMessage // poor man's string-is-a-json check shortcircuits full unmarshalling @@ -278,7 +278,7 @@ func (s *SpanWriter) shouldIndexTag(tag dbmodel.TagInsertion) bool { !isJSON(tag.TagValue) } -func (s *SpanWriter) logError(span *dbmodel.Span, err error, msg string, logger *zap.Logger) error { +func (*SpanWriter) logError(span *dbmodel.Span, err error, msg string, logger *zap.Logger) error { logger. With(zap.String("trace_id", span.TraceID.String())). With(zap.Int64("span_id", span.SpanID)). diff --git a/plugin/storage/es/spanstore/dbmodel/from_domain.go b/plugin/storage/es/spanstore/dbmodel/from_domain.go index daa90c16e49..e573a23a3ae 100644 --- a/plugin/storage/es/spanstore/dbmodel/from_domain.go +++ b/plugin/storage/es/spanstore/dbmodel/from_domain.go @@ -78,7 +78,7 @@ func (fd FromDomain) convertReferences(span *model.Span) []Reference { return out } -func (fd FromDomain) convertRefType(refType model.SpanRefType) ReferenceType { +func (FromDomain) convertRefType(refType model.SpanRefType) ReferenceType { if refType == model.FollowsFrom { return FollowsFrom } @@ -104,7 +104,7 @@ func (fd FromDomain) convertKeyValuesString(keyValues model.KeyValues) ([]KeyVal return kvs, tagsMap } -func (fd FromDomain) convertLogs(logs []model.Log) []Log { +func (FromDomain) convertLogs(logs []model.Log) []Log { out := make([]Log, len(logs)) for i, log := range logs { var kvs []KeyValue diff --git a/plugin/storage/es/spanstore/dbmodel/to_domain.go b/plugin/storage/es/spanstore/dbmodel/to_domain.go index cab2208edd1..2bdd34ff64c 100644 --- a/plugin/storage/es/spanstore/dbmodel/to_domain.go +++ b/plugin/storage/es/spanstore/dbmodel/to_domain.go @@ -102,7 +102,7 @@ func (td ToDomain) SpanToDomain(dbSpan *Span) (*model.Span, error) { return span, nil } -func (td ToDomain) convertRefs(refs []Reference) ([]model.SpanRef, error) { +func (ToDomain) convertRefs(refs []Reference) ([]model.SpanRef, error) { retMe := make([]model.SpanRef, len(refs)) for i, r := range refs { // There are some inconsistencies with ReferenceTypes, hence the hacky fix. @@ -194,7 +194,7 @@ func (td ToDomain) convertTagField(k string, v any) (model.KeyValue, error) { // convertKeyValue expects the Value field to be string, because it only works // as a reverse transformation after FromDomain() for ElasticSearch model. -func (td ToDomain) convertKeyValue(tag *KeyValue) (model.KeyValue, error) { +func (ToDomain) convertKeyValue(tag *KeyValue) (model.KeyValue, error) { if tag.Value == nil { return model.KeyValue{}, fmt.Errorf("invalid nil Value in %v", tag) } diff --git a/plugin/storage/es/spanstore/reader.go b/plugin/storage/es/spanstore/reader.go index 1285c399529..51a2e380edf 100644 --- a/plugin/storage/es/spanstore/reader.go +++ b/plugin/storage/es/spanstore/reader.go @@ -271,7 +271,7 @@ func (s *SpanReader) collectSpans(esSpansRaw []*elastic.SearchHit) ([]*model.Spa return spans, nil } -func (s *SpanReader) unmarshalJSONSpan(esSpanRaw *elastic.SearchHit) (*dbmodel.Span, error) { +func (*SpanReader) unmarshalJSONSpan(esSpanRaw *elastic.SearchHit) (*dbmodel.Span, error) { esSpanInByteArray := esSpanRaw.Source var jsonSpan dbmodel.Span @@ -606,7 +606,7 @@ func (s *SpanReader) buildTraceIDAggregation(numOfTraces int) elastic.Aggregatio SubAggregation(startTimeField, s.buildTraceIDSubAggregation()) } -func (s *SpanReader) buildTraceIDSubAggregation() elastic.Aggregation { +func (*SpanReader) buildTraceIDSubAggregation() elastic.Aggregation { return elastic.NewMaxAggregation(). Field(startTimeField) } @@ -643,7 +643,7 @@ func (s *SpanReader) buildFindTraceIDsQuery(traceQuery *spanstore.TraceQueryPara return boolQuery } -func (s *SpanReader) buildDurationQuery(durationMin time.Duration, durationMax time.Duration) elastic.Query { +func (*SpanReader) buildDurationQuery(durationMin time.Duration, durationMax time.Duration) elastic.Query { minDurationMicros := model.DurationAsMicroseconds(durationMin) maxDurationMicros := defaultMaxDuration if durationMax != 0 { @@ -652,7 +652,7 @@ func (s *SpanReader) buildDurationQuery(durationMin time.Duration, durationMax t return elastic.NewRangeQuery(durationField).Gte(minDurationMicros).Lte(maxDurationMicros) } -func (s *SpanReader) buildStartTimeQuery(startTimeMin time.Time, startTimeMax time.Time) elastic.Query { +func (*SpanReader) buildStartTimeQuery(startTimeMin time.Time, startTimeMax time.Time) elastic.Query { minStartTimeMicros := model.TimeAsEpochMicroseconds(startTimeMin) maxStartTimeMicros := model.TimeAsEpochMicroseconds(startTimeMax) // startTimeMillisField is date field in ES mapping. @@ -661,11 +661,11 @@ func (s *SpanReader) buildStartTimeQuery(startTimeMin time.Time, startTimeMax ti return elastic.NewRangeQuery(startTimeMillisField).Gte(minStartTimeMicros / 1000).Lte(maxStartTimeMicros / 1000) } -func (s *SpanReader) buildServiceNameQuery(serviceName string) elastic.Query { +func (*SpanReader) buildServiceNameQuery(serviceName string) elastic.Query { return elastic.NewMatchQuery(serviceNameField, serviceName) } -func (s *SpanReader) buildOperationNameQuery(operationName string) elastic.Query { +func (*SpanReader) buildOperationNameQuery(operationName string) elastic.Query { return elastic.NewMatchQuery(operationNameField, operationName) } @@ -684,7 +684,7 @@ func (s *SpanReader) buildTagQuery(k string, v string) elastic.Query { return elastic.NewBoolQuery().Should(queries...) } -func (s *SpanReader) buildNestedQuery(field string, k string, v string) elastic.Query { +func (*SpanReader) buildNestedQuery(field string, k string, v string) elastic.Query { keyField := fmt.Sprintf("%s.%s", field, tagKeyField) valueField := fmt.Sprintf("%s.%s", field, tagValueField) keyQuery := elastic.NewMatchQuery(keyField, k) @@ -693,7 +693,7 @@ func (s *SpanReader) buildNestedQuery(field string, k string, v string) elastic. return elastic.NewNestedQuery(field, tagBoolQuery) } -func (s *SpanReader) buildObjectQuery(field string, k string, v string) elastic.Query { +func (*SpanReader) buildObjectQuery(field string, k string, v string) elastic.Query { keyField := fmt.Sprintf("%s.%s", field, k) keyQuery := elastic.NewRegexpQuery(keyField, v) return elastic.NewBoolQuery().Must(keyQuery) diff --git a/plugin/storage/factory.go b/plugin/storage/factory.go index 378d26f6a93..4e6de6d29be 100644 --- a/plugin/storage/factory.go +++ b/plugin/storage/factory.go @@ -125,7 +125,7 @@ func NewFactory(config FactoryConfig) (*Factory, error) { return f, nil } -func (f *Factory) getFactoryOfType(factoryType string) (storage.Factory, error) { +func (*Factory) getFactoryOfType(factoryType string) (storage.Factory, error) { switch factoryType { case cassandraStorageType: return cassandra.NewFactory(), nil diff --git a/plugin/storage/factory_test.go b/plugin/storage/factory_test.go index ed49e75a328..b99aef57efc 100644 --- a/plugin/storage/factory_test.go +++ b/plugin/storage/factory_test.go @@ -422,19 +422,19 @@ var ( _ io.Closer = (*errorFactory)(nil) ) -func (e errorFactory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) error { +func (errorFactory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) error { panic("implement me") } -func (e errorFactory) CreateSpanReader() (spanstore.Reader, error) { +func (errorFactory) CreateSpanReader() (spanstore.Reader, error) { panic("implement me") } -func (e errorFactory) CreateSpanWriter() (spanstore.Writer, error) { +func (errorFactory) CreateSpanWriter() (spanstore.Writer, error) { panic("implement me") } -func (e errorFactory) CreateDependencyReader() (dependencystore.Reader, error) { +func (errorFactory) CreateDependencyReader() (dependencystore.Reader, error) { panic("implement me") } diff --git a/plugin/storage/grpc/factory.go b/plugin/storage/grpc/factory.go index fd39208f750..08dd2885597 100644 --- a/plugin/storage/grpc/factory.go +++ b/plugin/storage/grpc/factory.go @@ -72,7 +72,7 @@ func NewFactoryWithConfig( } // AddFlags implements plugin.Configurable -func (f *Factory) AddFlags(flagSet *flag.FlagSet) { +func (*Factory) AddFlags(flagSet *flag.FlagSet) { v1AddFlags(flagSet) } diff --git a/plugin/storage/grpc/shared/archive.go b/plugin/storage/grpc/shared/archive.go index 41741e7b950..1fceabddb03 100644 --- a/plugin/storage/grpc/shared/archive.go +++ b/plugin/storage/grpc/shared/archive.go @@ -58,22 +58,22 @@ func (r *archiveReader) GetTrace(ctx context.Context, traceID model.TraceID) (*m } // GetServices not used in archiveReader -func (r *archiveReader) GetServices(ctx context.Context) ([]string, error) { +func (*archiveReader) GetServices(ctx context.Context) ([]string, error) { return nil, errors.New("GetServices not implemented") } // GetOperations not used in archiveReader -func (r *archiveReader) GetOperations(ctx context.Context, query spanstore.OperationQueryParameters) ([]spanstore.Operation, error) { +func (*archiveReader) GetOperations(ctx context.Context, query spanstore.OperationQueryParameters) ([]spanstore.Operation, error) { return nil, errors.New("GetOperations not implemented") } // FindTraces not used in archiveReader -func (r *archiveReader) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error) { +func (*archiveReader) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error) { return nil, errors.New("FindTraces not implemented") } // FindTraceIDs not used in archiveReader -func (r *archiveReader) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { +func (*archiveReader) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { return nil, errors.New("FindTraceIDs not implemented") } diff --git a/plugin/storage/grpc/shared/grpc_handler.go b/plugin/storage/grpc/shared/grpc_handler.go index 794bbf7e6e8..9b235786a50 100644 --- a/plugin/storage/grpc/shared/grpc_handler.go +++ b/plugin/storage/grpc/shared/grpc_handler.go @@ -260,7 +260,7 @@ func (s *GRPCHandler) FindTraceIDs(ctx context.Context, r *storage_v1.FindTraceI }, nil } -func (s *GRPCHandler) sendSpans(spans []*model.Span, sendFn func(*storage_v1.SpansResponseChunk) error) error { +func (*GRPCHandler) sendSpans(spans []*model.Span, sendFn func(*storage_v1.SpansResponseChunk) error) error { chunk := make([]model.Span, 0, len(spans)) for i := 0; i < len(spans); i += spanBatchSize { chunk = chunk[:0] diff --git a/plugin/storage/integration/cassandra_test.go b/plugin/storage/integration/cassandra_test.go index 1e442d8d8ba..f61af7d1f84 100644 --- a/plugin/storage/integration/cassandra_test.go +++ b/plugin/storage/integration/cassandra_test.go @@ -50,7 +50,7 @@ func (s *CassandraStorageIntegration) cleanUp(t *testing.T) { require.NoError(t, s.factory.Purge(context.Background())) } -func (s *CassandraStorageIntegration) initializeCassandraFactory(t *testing.T, flags []string) *cassandra.Factory { +func (*CassandraStorageIntegration) initializeCassandraFactory(t *testing.T, flags []string) *cassandra.Factory { logger := zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller())) f := cassandra.NewFactory() v, command := config.Viperize(f.AddFlags) diff --git a/plugin/storage/integration/elasticsearch_test.go b/plugin/storage/integration/elasticsearch_test.go index e8534fc7dee..3f36334f7f9 100644 --- a/plugin/storage/integration/elasticsearch_test.go +++ b/plugin/storage/integration/elasticsearch_test.go @@ -107,7 +107,7 @@ func (s *ESStorageIntegration) esCleanUp(t *testing.T) { require.NoError(t, s.factory.Purge(context.Background())) } -func (s *ESStorageIntegration) initializeESFactory(t *testing.T, allTagsAsFields bool) *es.Factory { +func (*ESStorageIntegration) initializeESFactory(t *testing.T, allTagsAsFields bool) *es.Factory { logger := zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller())) f := es.NewFactory() v, command := config.Viperize(f.AddFlags) diff --git a/plugin/storage/integration/integration.go b/plugin/storage/integration/integration.go index 28b8546004e..cb61759dc47 100644 --- a/plugin/storage/integration/integration.go +++ b/plugin/storage/integration/integration.go @@ -132,7 +132,7 @@ func (s *StorageIntegration) skipIfNeeded(t *testing.T) { } } -func (s *StorageIntegration) waitForCondition(t *testing.T, predicate func(t *testing.T) bool) bool { +func (*StorageIntegration) waitForCondition(t *testing.T, predicate func(t *testing.T) bool) bool { const iterations = 100 // Will wait at most 100 seconds. for i := 0; i < iterations; i++ { if predicate(t) { @@ -364,7 +364,7 @@ func (s *StorageIntegration) loadParseAndWriteLargeTrace(t *testing.T) *model.Tr return trace } -func (s *StorageIntegration) getTraceFixture(t *testing.T, fixture string) *model.Trace { +func (*StorageIntegration) getTraceFixture(t *testing.T, fixture string) *model.Trace { fileName := fmt.Sprintf("fixtures/traces/%s.json", fixture) return getTraceFixtureExact(t, fileName) } diff --git a/plugin/storage/integration/kafka_test.go b/plugin/storage/integration/kafka_test.go index f333821f3c8..77d4cdfa79c 100644 --- a/plugin/storage/integration/kafka_test.go +++ b/plugin/storage/integration/kafka_test.go @@ -110,22 +110,22 @@ func (r *ingester) GetTrace(ctx context.Context, traceID model.TraceID) (*model. return r.traceStore.GetTrace(ctx, traceID) } -func (r *ingester) GetServices(ctx context.Context) ([]string, error) { +func (*ingester) GetServices(ctx context.Context) ([]string, error) { return nil, nil } -func (r *ingester) GetOperations( +func (*ingester) GetOperations( ctx context.Context, query spanstore.OperationQueryParameters, ) ([]spanstore.Operation, error) { return nil, nil } -func (r *ingester) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error) { +func (*ingester) FindTraces(ctx context.Context, query *spanstore.TraceQueryParameters) ([]*model.Trace, error) { return nil, nil } -func (r *ingester) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { +func (*ingester) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { return nil, nil } diff --git a/plugin/storage/kafka/factory.go b/plugin/storage/kafka/factory.go index fa65e51c553..fb27411b1e4 100644 --- a/plugin/storage/kafka/factory.go +++ b/plugin/storage/kafka/factory.go @@ -94,7 +94,7 @@ func (f *Factory) Initialize(metricsFactory metrics.Factory, logger *zap.Logger) } // CreateSpanReader implements storage.Factory -func (f *Factory) CreateSpanReader() (spanstore.Reader, error) { +func (*Factory) CreateSpanReader() (spanstore.Reader, error) { return nil, errors.New("kafka storage is write-only") } @@ -104,7 +104,7 @@ func (f *Factory) CreateSpanWriter() (spanstore.Writer, error) { } // CreateDependencyReader implements storage.Factory -func (f *Factory) CreateDependencyReader() (dependencystore.Reader, error) { +func (*Factory) CreateDependencyReader() (dependencystore.Reader, error) { return nil, errors.New("kafka storage is write-only") } diff --git a/plugin/storage/kafka/marshaller.go b/plugin/storage/kafka/marshaller.go index e39a96bf1ec..afba01a0ef9 100644 --- a/plugin/storage/kafka/marshaller.go +++ b/plugin/storage/kafka/marshaller.go @@ -35,7 +35,7 @@ func newProtobufMarshaller() *protobufMarshaller { } // Marshal encodes a span as a protobuf byte array -func (h *protobufMarshaller) Marshal(span *model.Span) ([]byte, error) { +func (*protobufMarshaller) Marshal(span *model.Span) ([]byte, error) { return proto.Marshal(span) } diff --git a/plugin/storage/kafka/options.go b/plugin/storage/kafka/options.go index 635e7526d63..98a2edb0088 100644 --- a/plugin/storage/kafka/options.go +++ b/plugin/storage/kafka/options.go @@ -118,7 +118,7 @@ type Options struct { } // AddFlags adds flags for Options -func (opt *Options) AddFlags(flagSet *flag.FlagSet) { +func (*Options) AddFlags(flagSet *flag.FlagSet) { flagSet.String( configPrefix+suffixRequiredAcks, defaultRequiredAcks, diff --git a/plugin/storage/kafka/unmarshaller.go b/plugin/storage/kafka/unmarshaller.go index 24161bd3940..226e8d70140 100644 --- a/plugin/storage/kafka/unmarshaller.go +++ b/plugin/storage/kafka/unmarshaller.go @@ -39,7 +39,7 @@ func NewProtobufUnmarshaller() *ProtobufUnmarshaller { } // Unmarshal decodes a protobuf byte array to a span -func (h *ProtobufUnmarshaller) Unmarshal(msg []byte) (*model.Span, error) { +func (*ProtobufUnmarshaller) Unmarshal(msg []byte) (*model.Span, error) { newSpan := &model.Span{} err := proto.Unmarshal(msg, newSpan) return newSpan, err @@ -54,7 +54,7 @@ func NewJSONUnmarshaller() *JSONUnmarshaller { } // Unmarshal decodes a json byte array to a span -func (h *JSONUnmarshaller) Unmarshal(msg []byte) (*model.Span, error) { +func (*JSONUnmarshaller) Unmarshal(msg []byte) (*model.Span, error) { newSpan := &model.Span{} err := jsonpb.Unmarshal(bytes.NewReader(msg), newSpan) return newSpan, err @@ -69,7 +69,7 @@ func NewZipkinThriftUnmarshaller() *ZipkinThriftUnmarshaller { } // Unmarshal decodes a json byte array to a span -func (h *ZipkinThriftUnmarshaller) Unmarshal(msg []byte) (*model.Span, error) { +func (*ZipkinThriftUnmarshaller) Unmarshal(msg []byte) (*model.Span, error) { tSpans, err := zipkin.DeserializeThrift(context.Background(), msg) if err != nil { return nil, err diff --git a/plugin/storage/memory/factory.go b/plugin/storage/memory/factory.go index f3b4a25e2b5..efaf0ac1c23 100644 --- a/plugin/storage/memory/factory.go +++ b/plugin/storage/memory/factory.go @@ -65,7 +65,7 @@ func NewFactoryWithConfig( } // AddFlags implements plugin.Configurable -func (f *Factory) AddFlags(flagSet *flag.FlagSet) { +func (*Factory) AddFlags(flagSet *flag.FlagSet) { AddFlags(flagSet) } @@ -115,12 +115,12 @@ func (f *Factory) CreateDependencyReader() (dependencystore.Reader, error) { } // CreateSamplingStore implements storage.SamplingStoreFactory -func (f *Factory) CreateSamplingStore(maxBuckets int) (samplingstore.Store, error) { +func (*Factory) CreateSamplingStore(maxBuckets int) (samplingstore.Store, error) { return NewSamplingStore(maxBuckets), nil } // CreateLock implements storage.SamplingStoreFactory -func (f *Factory) CreateLock() (distributedlock.Lock, error) { +func (*Factory) CreateLock() (distributedlock.Lock, error) { return &lock{}, nil } diff --git a/plugin/storage/memory/lock.go b/plugin/storage/memory/lock.go index 66eaef1a193..95f2530cf86 100644 --- a/plugin/storage/memory/lock.go +++ b/plugin/storage/memory/lock.go @@ -19,11 +19,11 @@ import "time" type lock struct{} // Acquire always returns true for memory storage because it's a single-node -func (l *lock) Acquire(resource string, ttl time.Duration) (bool, error) { +func (*lock) Acquire(resource string, ttl time.Duration) (bool, error) { return true, nil } // Forfeit always returns true for memory storage -func (l *lock) Forfeit(resource string) (bool, error) { +func (*lock) Forfeit(resource string) (bool, error) { return true, nil } diff --git a/plugin/storage/memory/memory.go b/plugin/storage/memory/memory.go index cae11e3ae8a..11fdd1dc074 100644 --- a/plugin/storage/memory/memory.go +++ b/plugin/storage/memory/memory.go @@ -278,7 +278,7 @@ func (st *Store) FindTraces(ctx context.Context, query *spanstore.TraceQueryPara } // FindTraceIDs is not implemented. -func (m *Store) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { +func (*Store) FindTraceIDs(ctx context.Context, query *spanstore.TraceQueryParameters) ([]model.TraceID, error) { return nil, errors.New("not implemented") } diff --git a/storage/spanstore/composite_test.go b/storage/spanstore/composite_test.go index d10b1deda1a..85aed7a98b4 100644 --- a/storage/spanstore/composite_test.go +++ b/storage/spanstore/composite_test.go @@ -31,13 +31,13 @@ var errIWillAlwaysFail = errors.New("ErrProneWriteSpanStore will always fail") type errProneWriteSpanStore struct{} -func (e *errProneWriteSpanStore) WriteSpan(ctx context.Context, span *model.Span) error { +func (*errProneWriteSpanStore) WriteSpan(ctx context.Context, span *model.Span) error { return errIWillAlwaysFail } type noopWriteSpanStore struct{} -func (n *noopWriteSpanStore) WriteSpan(ctx context.Context, span *model.Span) error { +func (*noopWriteSpanStore) WriteSpan(ctx context.Context, span *model.Span) error { return nil } diff --git a/storage/spanstore/downsampling_writer_test.go b/storage/spanstore/downsampling_writer_test.go index 42c3b0a7c70..5087015373d 100644 --- a/storage/spanstore/downsampling_writer_test.go +++ b/storage/spanstore/downsampling_writer_test.go @@ -28,7 +28,7 @@ import ( type noopWriteSpanStore struct{} -func (n *noopWriteSpanStore) WriteSpan(ct context.Context, span *model.Span) error { +func (*noopWriteSpanStore) WriteSpan(ct context.Context, span *model.Span) error { return nil } @@ -36,7 +36,7 @@ var errIWillAlwaysFail = errors.New("ErrProneWriteSpanStore will always fail") type errorWriteSpanStore struct{} -func (n *errorWriteSpanStore) WriteSpan(ctx context.Context, span *model.Span) error { +func (*errorWriteSpanStore) WriteSpan(ctx context.Context, span *model.Span) error { return errIWillAlwaysFail }