Skip to content

Conversation

@Mohamed-Elwasila
Copy link

Summary

  • Extracted duplicate logic for building needs and strategy maps into buildNeedsAndStrategy() helper function
  • Refactored NewExpressionEvaluatorWithEnv() and newStepExpressionEvaluator() to use the new helper
  • Removed completed TODO comments about cleanup

Motivation

There was duplicate code (~20 lines) in two functions that built the same needs and strategy maps for expression evaluation. This refactoring improves maintainability and reduces the chance of inconsistencies.

Test Plan

  • Code builds successfully (go build ./...)
  • No linting errors (golangci-lint run)
  • Code formatted with go fmt

Fixes TODO items in pkg/runner/expression.go:37 and pkg/runner/expression.go:124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant