Copilot commented on code in PR #3662:
URL: https://github.com/apache/dubbo-go/pull/3662#discussion_r3788383133


##########
cluster/router/options.go:
##########
@@ -31,6 +33,7 @@ func defaultOptions() *Options {
        }
 }
 
+// NewOptions returns router options initialized with the default router 
configuration.

Review Comment:
   The comment for `NewOptions` says it returns “router options”, but the 
function returns an `*Options` value. Tweaking the wording makes the public API 
doc clearer and less ambiguous.



##########
cluster/router/chain/cache.go:
##########
@@ -62,6 +63,8 @@ func (c *routerCache) GetInvokers() []base.Invoker {
 // snapshot for the given Poolable. The returned invokers slice is shared and 
must not be
 // modified by the caller. The generation is always returned (even on a miss) 
so callers can
 // detect a snapshot rebuilt by a concurrent SetInvokers.
+// The lookup key is Poolable.Name. A hit returns the pool with its invoker 
snapshot and
+// generation; a miss returns a nil pool, nil invokers, and the current 
generation.

Review Comment:
   The doc comment says the cache key is `Poolable.Name`, but the code uses 
`p.Name()` (the method call). Using `Poolable.Name()` in the comment avoids 
ambiguity and matches the interface contract.



-- 
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]

Reply via email to