Harry33t opened a new issue, #1082:
URL: https://github.com/apache/dubbo-go-samples/issues/1082
## 问题描述
我在本地测试 config_center/zookeeper sample 时,发现代码注释中描述的 dataId 与实际使用的 dataId 不一致。
代码注释中写的是:
> // dataid is 'dubbo-go-samples-configcenter-zookeeper-server'
但是实际代码中使用的是:
>
config_center.WithDataID("dubbo-go-samples-configcenter-zookeeper-go-server")
两者差异是实际值中多了 -go-:
```
dubbo-go-samples-configcenter-zookeeper-server
dubbo-go-samples-configcenter-zookeeper-go-server
```
这会让用户在理解配置中心示例时产生困惑,也容易导致手动查看或修改 Zookeeper 配置节点时找错 dataId。
##复现步骤
查看文件:
> config_center/zookeeper/go-server/cmd/main.go
可以看到注释中的 dataId 与实际 WithDataID(...) 参数不一致。
### 实际结果
注释中的 dataId:
> dubbo-go-samples-configcenter-zookeeper-server
实际代码使用的 dataId:
> dubbo-go-samples-configcenter-zookeeper-go-server
### 预期结果:
> 注释、README 和实际代码中的 dataId 应保持一致,避免用户误解。
## 建议修复方式
如果实际代码中的 dataId 是期望值,建议将注释改为:
// dataid is 'dubbo-go-samples-configcenter-zookeeper-go-server'
或者如果希望 dataId 更简洁,也可以反过来统一代码与文档。
## 影响
这是一个文档/注释一致性问题。它不会阻塞 sample 启动,但会影响用户理解配置中心示例,尤其是在用户想手动查看 Zookeeper
中的配置数据时,容易根据注释查找错误的 dataId。
如果这个修复方向可以接受,我可以继续提交 PR。
--
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]