incubator-seata-go
incubator-seata-go copied to clipboard
reconstruction the getty module
What would you like to be added:
Why is this needed:
@georgehao 你是基于什么原因想要重构getty模块的?我这里也发现了getty模块的一点问题,可能需要重构来解决。
问题如下: getty模块所依赖的getty.Session接口中,定义了小写开头的私有方法。这导致我们无法在seata-go中对Session接口进行mock,不方便单元测试,影响测试覆盖率。
RoBot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
@georgehao What is your reason for wanting to refactor the getty module? I also found a little problem with the getty module here, which may need to be refactored to solve it.
Questions are as follows: In the getty.Session interface on which the getty module depends, private methods starting with lowercase are defined. This makes it impossible for us to mock the Session interface in seata-go, which is inconvenient for unit testing and affects test coverage.
getty 到处都是用的单例模式,这点不太能接受。模块跟模块之间的联系表达的不清晰
RoBot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑🤝🧑👫🧑🏿🤝🧑🏻👩🏾🤝👨🏿👬🏿
The singleton pattern used everywhere in getty is not acceptable. The relationship between modules and modules is not clearly expressed