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

interface{} return values and nil: What explains the behavior of this playground link? #43425

Closed
dzrtc opened this issue Dec 30, 2020 · 3 comments

Comments

@dzrtc
Copy link

dzrtc commented Dec 30, 2020

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

$ go version
The Google Playground

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
The Google Playground

What did you do?

https://play.golang.org/p/rD_TkhU5VvA

What did you expect to see?

I expected reallynil to be true in output lines 2 and 3.

What did you see instead?

reallynil on line 2 is false. What explains this behavior? Is there a link to an explanation in the Go spec?

@dzrtc
Copy link
Author

dzrtc commented Dec 30, 2020

Background: I ran into this issue while trying to implement and work with os.FileInfo which has a Sys() interface{} method.

@davecheney
Copy link
Contributor

Thank you for raising this issue. Please consult this entry from the Go faq

https://golang.org/doc/faq#nil_error

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For asking questions, see:

@dzrtc
Copy link
Author

dzrtc commented Dec 30, 2020

@davecheney Thanks for the link to FAQ.

@golang golang locked and limited conversation to collaborators Dec 30, 2021
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