From 6bc7e16c99de6446119ac2228270641383906ee2 Mon Sep 17 00:00:00 2001 From: Aryan Goyal <137564277+ary82@users.noreply.github.com> Date: Wed, 8 Jan 2025 22:12:32 +0530 Subject: [PATCH] lint: variable names fix Signed-off-by: Aryan Goyal <137564277+ary82@users.noreply.github.com> --- .../internal/source/filesource/filesource.go | 4 ++-- .../internal/source/filesource/filesource_test.go | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/extension/jaegerremotesampling/internal/source/filesource/filesource.go b/extension/jaegerremotesampling/internal/source/filesource/filesource.go index b2b6f4482d96..f0334c3cbe1d 100644 --- a/extension/jaegerremotesampling/internal/source/filesource/filesource.go +++ b/extension/jaegerremotesampling/internal/source/filesource/filesource.go @@ -71,7 +71,7 @@ func NewFileSource(options Options, logger *zap.Logger) (source.Source, error) { h.logger.Warn("Default operations level strategies will not be included for Ratelimiting service strategies." + "This behavior will be changed in future releases. " + "Cf. https://github.com/jaegertracing/jaeger/issues/5270") - h.parseStrategies_deprecated(strategies) + h.parseStrategiesDeprecated(strategies) } else { h.parseStrategies(strategies) } @@ -209,7 +209,7 @@ func loadStrategies(loadFn strategyLoader) (*strategies, error) { return strategies, nil } -func (h *samplingProvider) parseStrategies_deprecated(strategies *strategies) { +func (h *samplingProvider) parseStrategiesDeprecated(strategies *strategies) { newStore := defaultStrategies() if strategies.DefaultStrategy != nil { newStore.defaultStrategy = h.parseServiceStrategies(strategies.DefaultStrategy) diff --git a/extension/jaegerremotesampling/internal/source/filesource/filesource_test.go b/extension/jaegerremotesampling/internal/source/filesource/filesource_test.go index 099e10c015fa..fae69d1e913b 100644 --- a/extension/jaegerremotesampling/internal/source/filesource/filesource_test.go +++ b/extension/jaegerremotesampling/internal/source/filesource/filesource_test.go @@ -515,7 +515,7 @@ func TestServiceNoPerOperationStrategies(t *testing.T) { t.Run(service, func(t *testing.T) { strategy, err := provider.GetSamplingStrategy(context.Background(), service) require.NoError(t, err) - strategyJson, err := json.MarshalIndent(strategy, "", " ") + strategyJSON, err := json.MarshalIndent(strategy, "", " ") require.NoError(t, err) testName := strings.ReplaceAll(t.Name(), "/", "_") @@ -523,11 +523,11 @@ func TestServiceNoPerOperationStrategies(t *testing.T) { expectedServiceResponse, err := os.ReadFile(snapshotFile) require.NoError(t, err) - assert.JSONEq(t, string(expectedServiceResponse), string(strategyJson), + assert.JSONEq(t, string(expectedServiceResponse), string(strategyJSON), "comparing against stored snapshot. Use REGENERATE_SNAPSHOTS=true to rebuild snapshots.") if regenerateSnapshots { - err = os.WriteFile(snapshotFile, strategyJson, 0o600) + err = os.WriteFile(snapshotFile, strategyJSON, 0o600) require.NoError(t, err) } }) @@ -548,7 +548,7 @@ func TestServiceNoPerOperationStrategiesDeprecatedBehavior(t *testing.T) { t.Run(service, func(t *testing.T) { strategy, err := provider.GetSamplingStrategy(context.Background(), service) require.NoError(t, err) - strategyJson, err := json.MarshalIndent(strategy, "", " ") + strategyJSON, err := json.MarshalIndent(strategy, "", " ") require.NoError(t, err) testName := strings.ReplaceAll(t.Name(), "/", "_") @@ -556,11 +556,11 @@ func TestServiceNoPerOperationStrategiesDeprecatedBehavior(t *testing.T) { expectedServiceResponse, err := os.ReadFile(snapshotFile) require.NoError(t, err) - assert.JSONEq(t, string(expectedServiceResponse), string(strategyJson), + assert.JSONEq(t, string(expectedServiceResponse), string(strategyJSON), "comparing against stored snapshot. Use REGENERATE_SNAPSHOTS=true to rebuild snapshots.") if regenerateSnapshots { - err = os.WriteFile(snapshotFile, strategyJson, 0o600) + err = os.WriteFile(snapshotFile, strategyJSON, 0o600) require.NoError(t, err) } })