-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
proposal: Go 2: Discard methods #35206
Comments
IMO a better solution would be to use the delegation pattern:
It's not worth it to convolute the language just to save a few lines of code. |
it is feasible if the number of methods is small, but when the number of methods is large, it will cause lots of work. I will encounter this situation in my actually development, which resulting a large number of duplicate code. Of course, you can design a new parent structure, but it's still a good amount of work.Because the project already largely depend on the parent structure. |
|
It seems that interface is a better choice. |
Better from the view of aesthetics. In fact, the following one is more memory saving:
|
What is the problem of having more methods than you are using? |
#35206 (comment) shows a different way to implement this without changing the language. This proposal as is does not have strong support. For these reasons, this is a likely decline. Leaving open for four weeks for final comments. |
No final comments. Closing. |
Provides a way to disable method。
Sometime I will inherit a large number of method when I combine a structure, however I want to abandon some of those methods
The text was updated successfully, but these errors were encountered: