gf icon indicating copy to clipboard operation
gf copied to clipboard

feat(net/ghttp): remove `Req/Res` suffix limitation for input/output parameters of strict router handler

Open gqcn opened this issue 1 year ago • 22 comments

gqcn avatar Oct 08 '24 12:10 gqcn

什么原因导致要移除呢?不要做一个善变的难人

houseme avatar Oct 08 '24 12:10 houseme

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


What is the reason for removal? Don't be a fickle 'difficult person'

Issues-translate-bot avatar Oct 08 '24 12:10 Issues-translate-bot

@gqcn 为啥要移除呢? Difficult person?

oldme-git avatar Oct 09 '24 01:10 oldme-git

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@gqcn Why should we remove it? Difficult person?

Issues-translate-bot avatar Oct 09 '24 01:10 Issues-translate-bot

@houseme @oldme-git 我反思,总感觉一个通用的Server组件做这个命名限制没有什么太大必要,大家觉得呢?

gqcn avatar Oct 09 '24 05:10 gqcn

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@houseme @oldme-git I'm so annoyed. I always feel that it's not necessary for a general Server component to have this naming restriction. What do you think?

Issues-translate-bot avatar Oct 09 '24 05:10 Issues-translate-bot

@gqcn 还是别改来改去的,大家都用习惯了

oldme-git avatar Oct 09 '24 05:10 oldme-git

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@gqcn It’s better not to change it again and again, everyone is used to it.

Issues-translate-bot avatar Oct 09 '24 05:10 Issues-translate-bot

@gqcn 还是别改来改去的,大家都用习惯了

老不正经了,善变的娃

houseme avatar Oct 09 '24 09:10 houseme

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@gqcn It’s better not to change it again and again, everyone is used to it.

You're too old to be serious, you're a fickle kid.

Issues-translate-bot avatar Oct 09 '24 09:10 Issues-translate-bot

支持。应该去掉没有必要的限制。有这个习惯的用户可以继续这样命名。 @gqcn

zcyc avatar Oct 16 '24 08:10 zcyc

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


support. Unnecessary restrictions should be removed. Users who have this habit can continue to name them this way. @gqcn

Issues-translate-bot avatar Oct 16 '24 08:10 Issues-translate-bot

gen service 必须以 s 开头是不是也可以去掉。 @gqcn

zcyc avatar Oct 16 '24 09:10 zcyc

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


gen service must start with s. Can it be removed?

Issues-translate-bot avatar Oct 16 '24 09:10 Issues-translate-bot

gen service 必须以 s 开头是不是也可以去掉。 @gqcn

s开头的service struct设计是因为要区分那些struct需要导出为service

gqcn avatar Oct 16 '24 14:10 gqcn

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


gen service must start with s. Can it be removed? @gqcn

The service struct starting with s is designed to distinguish those struct that need to be exported as service.

Issues-translate-bot avatar Oct 16 '24 14:10 Issues-translate-bot

gen service 必须以 s 开头是不是也可以去掉。 @gqcn

s开头的service struct设计是因为要区分那些struct需要导出为service

可否采用 AST 方案,获取接收器。可能有些接收器不需要导出,这里还要再想想。 现在这个限制,每次做到 s 开头的功能都不知道怎么优雅取名,比如:ssh。

zcyc avatar Oct 17 '24 02:10 zcyc

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


gen service must start with s. Can it be removed? @gqcn

The service struct starting with s is designed to distinguish those struct that need to be exported as service.

Is it possible to use AST scheme to obtain the receiver struct. Now with this limitation, every time I try to implement a function that starts with s, I don’t know how to name it elegantly, such as: ssh.

Issues-translate-bot avatar Oct 17 '24 02:10 Issues-translate-bot

gen service 必须以 s 开头是不是也可以去掉。 @gqcn

s开头的service struct设计是因为要区分那些struct需要导出为service

可否采用 AST 方案,获取接收器。可能有些接收器不需要导出,这里还要再想想。 现在这个限制,每次做到 s 开头的功能都不知道怎么优雅取名,比如:ssh。

ssh 这个毕竟还是少量或特殊状态

houseme avatar Oct 17 '24 02:10 houseme

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


gen service must start with s. Can it be removed? @gqcn

The service struct starting with s is designed to distinguish those struct that need to be exported as service.

Is it possible to use AST scheme to obtain the receiver. There may be some receivers that do not need to be exported, so we need to think about it again. Now with this limitation, every time I try to implement a function that starts with s, I don’t know how to name it elegantly, such as: ssh.

After all, ssh is still a small amount or a special state.

Issues-translate-bot avatar Oct 17 '24 02:10 Issues-translate-bot

gen service 必须以 s 开头是不是也可以去掉。 @gqcn

s开头的service struct设计是因为要区分那些struct需要导出为service

可否采用 AST 方案,获取接收器。可能有些接收器不需要导出,这里还要再想想。 现在这个限制,每次做到 s 开头的功能都不知道怎么优雅取名,比如:ssh。

ssh 这个毕竟还是少量或特殊状态

ssh 当然特殊,我举例子肯定举最能说明问题的例子,其他以 s 开头的单词很多。 school,screen,sale,类似的单词按这个规则都不优雅 sSchool,sScreen,sSale。

zcyc avatar Oct 17 '24 03:10 zcyc

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


gen service must start with s. Can it be removed? @gqcn

The service struct starting with s is designed to distinguish those structs that need to be exported as service.

Is it possible to use AST scheme to obtain the receiver. There may be some receivers that do not need to be exported, so we need to think about it again. Now with this limitation, every time I try to implement a function that starts with s, I don’t know how to name it elegantly, such as: ssh.

ssh is still a small amount or a special state after all.

Of course, ssh is special. When I give an example, I will definitely give the one that best illustrates the problem. There are many other words starting with s. School, screen, sale, similar words are not elegant according to this rule: sSchool, sScreen, sSale.

Issues-translate-bot avatar Oct 17 '24 03:10 Issues-translate-bot

@houseme @oldme-git 随着使用的用户越来越多,我们的基础组件应该更具有开放性,不应该在基础组件上做一些毫无意义的规范性的命名强限制。我是这么理解的。

gqcn avatar Nov 11 '24 12:11 gqcn

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@houseme @oldme-git As more and more users use it, our basic components should be more open and should not impose some meaningless normative naming restrictions on basic components. That's how I understand it.

Issues-translate-bot avatar Nov 11 '24 12:11 Issues-translate-bot

对,基础组件要有包容性。你们认为好的规范,可以作为最佳实践发布,供有需要的人选择。

zcyc avatar Nov 12 '24 02:11 zcyc

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Yes, the basic components must be inclusive. The specifications you think are good can be released as best practices for those who need them to choose from.

Issues-translate-bot avatar Nov 12 '24 02:11 Issues-translate-bot

朋友们,如果觉得可以就点个同意吧,有不同意见可以一起讨论。

gqcn avatar Nov 12 '24 12:11 gqcn

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Friends, if you think you can agree, please agree. If you have different opinions, you can discuss them together.

Issues-translate-bot avatar Nov 12 '24 12:11 Issues-translate-bot

@gqcn 可以把Req/Res去掉,代码不强制要求,但是需要在文档里确定一下框架规范

oldme-git avatar Nov 12 '24 12:11 oldme-git

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@gqcn You can remove Req/Res. The code is not mandatory, but you need to confirm the framework specification in the document.

Issues-translate-bot avatar Nov 12 '24 12:11 Issues-translate-bot