improve code readability#3446
Conversation
|
Hey @cxljs, thanks for your contribution. |
|
Hello @ndyakov , the reason for reducing line breaks is that there will be a comma after the last parameter, which often makes me think there are more parameters on the next line. e.g.: func masterReplicaDialer(
failover *sentinelFailover,
) func(ctx context.Context, network, addr string) (net.Conn, error) {But this is just my personal opinion, if you think multiline function declaration is better for readibility, let's keep it as it is. |
|
I do have a preference, but I am not the only person working on this :) @htemelski-redis , @ofekshenawa feel free to share your opinions. |
|
I am a bit on the fence about the function definitions. func (c cmdable) GeoRadiusByMember(
ctx context.Context,
key, member string,
query *GeoRadiusQuery,
) *GeoLocationCmd { |
|
I also do like what @htemelski-redis is suggesting. |
3bfb847 to
eb8df22
Compare
|
I've reverted the function definitions to their original format. |
eb8df22 to
0be47f1
Compare
- replace two similar functions `appendUniqueNode` and `appendIfNotExists` with a generic function. - simplify the implementation of the `get` method in `clusterNodes` - keep the member name `_generation` of `clusterNodes` consistent with other types. - rename a data member `_masterAddr` to `masterAddr`. Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
0be47f1 to
a7fb1aa
Compare
- replace two similar functions `appendUniqueNode` and `appendIfNotExists` with a generic function. - simplify the implementation of the `get` method in `clusterNodes` - keep the member name `_generation` of `clusterNodes` consistent with other types. - rename a data member `_masterAddr` to `masterAddr`. Signed-off-by: Xiaolong Chen <fukua95@gmail.com>
replace two similar functions
appendUniqueNodeandappendIfNotExistswith a generic function.simplify the implementation of the
getmethod inclusterNodes.keep the member name
_generationofclusterNodesconsistent with other types.rename a data member
_masterAddrtomasterAddr.