Alanxtl commented on code in PR #3635:
URL: https://github.com/apache/dubbo-go/pull/3635#discussion_r3747140207
##########
metadata/report/zookeeper/report.go:
##########
@@ -211,14 +212,29 @@ func (m *zookeeperMetadataReport)
RemoveServiceAppMappingListener(key string, gr
type zookeeperMetadataReportFactory struct{}
-// CreateMetadataReport creates the zookeeper-based metadata report
implementation.
-func (mf *zookeeperMetadataReportFactory) CreateMetadataReport(url
*common.URL) report.MetadataReport {
- client, err := gxzookeeper.NewZookeeperClient(
- "zookeeperMetadataReport",
+// newZookeeperClient is a stub point for tests. It takes a plain timeout
+// instead of gost's unexported option type so tests can replace it.
+var newZookeeperClient = func(name string, zkAddrs []string, share bool,
timeout time.Duration) (*gxzookeeper.ZookeeperClient, error) {
+ return gxzookeeper.NewZookeeperClient(name, zkAddrs, share,
gxzookeeper.WithZkTimeOut(timeout))
+}
Review Comment:
不用再包一层了吧
--
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]