mochengqian commented on PR #963:
URL: https://github.com/apache/dubbo-go-pixiu/pull/963#issuecomment-4646559306
## Addressed Copilot Review Comments
Commit 00419d6 addresses both inline comments:
**Comment 1 (sync.Once mismatch)**: Added `sync.Once` to `Plugin` with a
lazy `cooldownStore()` accessor. The implementation now matches the PR
description's claim of "lazily owns (sync.Once)".
**Comment 2 (zero-value safety)**: `CreateFilterFactory` now calls
`p.cooldownStore()` instead of directly accessing `p.cooldowns`. This ensures
zero-value `Plugin` construction (`&Plugin{}`) safely initializes the store on
first use, upholding the "non-nil store" contract without requiring callers to
use `newPlugin()`.
Tests updated to use zero-value construction (`&Plugin{}`) proving the
defensive initialization works.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]