Skip to content

Set default value for functions or methods params #18765

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

Closed
francknouama opened this issue Jan 23, 2017 · 2 comments
Closed

Set default value for functions or methods params #18765

francknouama opened this issue Jan 23, 2017 · 2 comments

Comments

@francknouama
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.7.4

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"

What did you do?

N/A: Not an issue, more a request for an additional feature

What did you expect to see?

I was expecting the language to allow to define default value for function parameters as we can do with python and scala

What did you see instead?

This feature is not available

@bradfitz
Copy link
Contributor

Sorry, Go does not support this.

For questions about Go, see https://golang.org/wiki/Questions.

For language change proposals, see https://github.com/golang/proposal/ but be aware that Go 1 is pretty frozen at this point.

@francknouama
Copy link
Author

thanks @bradfitz

@golang golang locked and limited conversation to collaborators Jan 23, 2018
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

3 participants