Skip to content

Modernize for loop to use range-based iteration - #355

Merged
gab-arrobo merged 1 commit into
omec-project:mainfrom
gab-arrobo:modernize-for-loop
Aug 18, 2026
Merged

Modernize for loop to use range-based iteration#355
gab-arrobo merged 1 commit into
omec-project:mainfrom
gab-arrobo:modernize-for-loop

Conversation

@gab-arrobo

Copy link
Copy Markdown
Contributor

No description provided.

@gab-arrobo
gab-arrobo requested review from a team and a lite review from Copilot August 18, 2026 20:41
Signed-off-by: Arrobo, Gabriel <gabriel.arrobo@intel.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes several index-based for loops to idiomatic Go range loops across the producer data repository logic and its concurrency-safety test, keeping behavior the same while simplifying iteration code.

Changes:

  • Replaced index-based iteration over []map[string]interface{} results with for _, d := range ... loops while deleting MongoDB-inserted/internal fields.
  • Updated test loops to use Go’s integer range form (for u := range ueCount, for range perUeRequests) for generating IDs and driving concurrent requests.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
producer/data_repository.go Simplifies loops that strip internal MongoDB/application fields from DB result maps using range.
producer/data_repository_test.go Modernizes loop syntax in the concurrency-safety test while preserving iteration counts and behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@gab-arrobo
gab-arrobo merged commit 08b23a9 into omec-project:main Aug 18, 2026
12 checks passed
@gab-arrobo
gab-arrobo deleted the modernize-for-loop branch August 18, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants