Navigation Menu

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

proposal: Go2: remove from spec implicitly returned parameters #28161

Closed
kf6nux opened this issue Oct 11, 2018 · 3 comments
Closed

proposal: Go2: remove from spec implicitly returned parameters #28161

kf6nux opened this issue Oct 11, 2018 · 3 comments

Comments

@kf6nux
Copy link

kf6nux commented Oct 11, 2018

Relates to issue #28160

Go1 spec allows for 2 different return statement styles causing unnecessary added complexity and confusion for some developers.

Using an example func from the spec:

func complexF3() (re float64, im float64) {
	re = 7.0
	im = 4.0
	return
}
// vs
func complexF3() (re float64, im float64) {
	re = 7.0
	im = 4.0
	return re, im
}

This proposal is to remove implicitly returned result parameters from the spec, thereby requiring result parameters to always be explicitly returned.

@gopherbot gopherbot added this to the Proposal milestone Oct 11, 2018
@deanveloper
Copy link

deanveloper commented Oct 11, 2018

Duplicate of #21291 ?

@jimmyfrasche
Copy link
Member

Yes it is, thank you @deanveloper

@kf6nux please continue the discussion there.

@kf6nux
Copy link
Author

kf6nux commented Oct 11, 2018

Sorry, I did search ahead of time and missed it. Thanks for the link!

@golang golang locked and limited conversation to collaborators Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants