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

Merged same types of function parameters #2224

Closed
wants to merge 1 commit into from
Closed

Merged same types of function parameters #2224

wants to merge 1 commit into from

Conversation

iamrajiv
Copy link
Contributor

@iamrajiv iamrajiv commented Jul 7, 2021

Description

If parameters of the same type lie consecutively, mention their type once at the end of the last parameter. Unlike other languages, like C, where all parameters must be specified with types explicitly, it is not required to do so in Go. Combining the types is usually recommended for the sake of brevity.

Signed-off-by: Rajiv Ranjan Singh <rajivperfect007@gmail.com>
@google-cla google-cla bot added the cla: yes label Jul 7, 2021
Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Rajiv. Thanks for your contribution. Unfortunately, there are a few problems with this contribution:

  1. You've manually changed some of the generated files, which is why the CI job is failing. You'll need to regenerate them and ignore those files in your editing.
  2. I'm not sure I actually agree with this change. I've heard a compelling argument against using these sorts of signatures, which is that it's easier to add a parameter with the wrong type by mistake, because you don't need to add the type. As such, I'm not convinced there is merit in this change in general, sorry.

@iamrajiv iamrajiv closed this Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants