Skip to content

Conversation

@jiekun
Copy link
Member

@jiekun jiekun commented Oct 2, 2025

Describe Your Changes

follow-up of #709 per comment #709 (comment)

  1. Renamed var wgWorkers sync.WaitGroup to wg.
  2. Place wg.Done() at the beginning of the goroutine function with defer, instead of at the end of the function.
  3. (minor) renamed variable i in for-loop to workerID. Because it conflict with for i := range bsws in the goroutine. While it does not affect the execution, there's nothing bad to make it clear and unique.

Again, the CHANGELOG is left empty intentionally.

Checklist

The following checks are mandatory:

@jiekun jiekun requested review from Copilot, func25 and valyala October 2, 2025 09:13
Copy link
Contributor

Copilot AI left a comment

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 standardizes the naming convention for sync.WaitGroup variables to wg and improves goroutine cleanup patterns. The changes follow up on PR #709 to maintain consistency across the codebase.

  • Renamed wgWorkers to wg for consistency with project naming conventions
  • Moved wg.Done() to use defer pattern at the beginning of goroutines for better cleanup
  • Renamed loop variable i to workerID to avoid naming conflicts and improve clarity

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@valyala valyala merged commit b134e33 into master Oct 2, 2025
8 checks passed
@valyala valyala deleted the chore-code-style-wg branch October 2, 2025 10:53
@valyala
Copy link
Contributor

valyala commented Oct 2, 2025

@jiekun , thank you for the pull request, which improves the consistency of VictoriaLogs source code!

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.

2 participants