Skip to content

Commit

Permalink
lint: variable names fix
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan Goyal <[email protected]>
  • Loading branch information
ary82 committed Jan 8, 2025
1 parent 50def7e commit 6bc7e16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,19 +515,19 @@ 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(), "/", "_")
snapshotFile := filepath.Join(snapshotLocation, testName+".json")
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)
}
})
Expand All @@ -548,19 +548,19 @@ 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(), "/", "_")
snapshotFile := filepath.Join(snapshotLocation, testName+".json")
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)
}
})
Expand Down

0 comments on commit 6bc7e16

Please sign in to comment.