Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Nov 14, 2024

Conversation

gqcn
Copy link
Member

@gqcn gqcn commented Oct 8, 2024

No description provided.

@houseme
Copy link
Member

houseme commented Oct 8, 2024

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

@Issues-translate-bot
Copy link

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'

@oldme-git
Copy link
Member

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

@Issues-translate-bot
Copy link

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


@gqcn Why should we remove it? Difficult person?

@gqcn
Copy link
Member Author

gqcn commented Oct 9, 2024

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

@Issues-translate-bot
Copy link

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?

@gqcn gqcn added enhancement discuss We need discuss to make decision. labels Oct 9, 2024
@oldme-git
Copy link
Member

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

@Issues-translate-bot
Copy link

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.

@houseme
Copy link
Member

houseme commented Oct 9, 2024

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

老不正经了,善变的娃

@Issues-translate-bot
Copy link

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.

@zcyc
Copy link
Contributor

zcyc commented Oct 16, 2024

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

@Issues-translate-bot
Copy link

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

@zcyc
Copy link
Contributor

zcyc commented Oct 16, 2024

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

@Issues-translate-bot
Copy link

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


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

@gqcn
Copy link
Member Author

gqcn commented Oct 16, 2024

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

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

@Issues-translate-bot
Copy link

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.

@zcyc
Copy link
Contributor

zcyc commented Oct 17, 2024

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

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

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

@Issues-translate-bot
Copy link

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.

@houseme
Copy link
Member

houseme commented Oct 17, 2024

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

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

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

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

@Issues-translate-bot
Copy link

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.

@zcyc
Copy link
Contributor

zcyc commented Oct 17, 2024

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

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

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

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

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

@Issues-translate-bot
Copy link

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.

@gqcn
Copy link
Member Author

gqcn commented Nov 11, 2024

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

@Issues-translate-bot
Copy link

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.

@zcyc
Copy link
Contributor

zcyc commented Nov 12, 2024

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

@Issues-translate-bot
Copy link

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.

@gqcn
Copy link
Member Author

gqcn commented Nov 12, 2024

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

@Issues-translate-bot
Copy link

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.

@oldme-git
Copy link
Member

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

@Issues-translate-bot
Copy link

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.

@gqcn
Copy link
Member Author

gqcn commented Nov 12, 2024

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

我觉得行。

@Issues-translate-bot
Copy link

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.

I think it works.

@lingcoder
Copy link
Contributor

目前用着挺顺手的,习惯了,平常也这么要求大家遵守的。不强制也没关系,希望修改后gf gen不出新的BUG。

@Issues-translate-bot
Copy link

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


It's pretty easy to use now, I'm used to it, and I usually ask everyone to abide by it. It doesn’t matter if it’s not mandatory. I hope gf gen won’t cause new bugs after the modification.

@gqcn gqcn merged commit 3d4904e into master Nov 14, 2024
40 checks passed
@gqcn gqcn deleted the feature/ghttp-remove-req-res-naming-limitation branch November 14, 2024 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss We need discuss to make decision. enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants