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

nil check on interface not working properly #17067

Closed
bocajim opened this issue Sep 11, 2016 · 1 comment
Closed

nil check on interface not working properly #17067

bocajim opened this issue Sep 11, 2016 · 1 comment

Comments

@bocajim
Copy link

bocajim commented Sep 11, 2016

Please answer these questions before submitting your issue. Thanks!

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

go version go1.7.1 windows/amd64

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

set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1

What did you do?

https://play.golang.org/p/ZePYwF-z_v

What did you expect to see?

I expected the nil check to be properly evaluated (and the 2nd printf not to be seen).

What did you see instead?

Using a structure that implements an interface, and returning nil resulted in a nil check that failed.

@bradfitz
Copy link
Contributor

@golang golang locked and limited conversation to collaborators Sep 11, 2017
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