We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version go1.23.0 darwin/arm64
go env
GO111MODULE='' GOARCH='arm64' GOBIN='' GOEXE='' GOEXPERIMENT='' GOFLAGS='' GOHOSTARCH='arm64' GOHOSTOS='darwin' GOINSECURE='' GONOPROXY='' GONOSUMDB='' GOOS='darwin' GOPRIVATE='' GOPROXY='https://proxy.golang.org,direct' GOSUMDB='sum.golang.org' GOTMPDIR='' GOTOOLCHAIN='auto' GOVCS='' GOVERSION='go1.23.0' GODEBUG='' GOTELEMETRY='local' GCCGO='gccgo' GOARM64='v8.0' AR='ar' CC='clang' CXX='clang++' CGO_ENABLED='1' GOWORK='' CGO_CFLAGS='-O2 -g' CGO_CPPFLAGS='' CGO_CXXFLAGS='-O2 -g' CGO_FFLAGS='-O2 -g' CGO_LDFLAGS='-O2 -g' PKG_CONFIG='pkg-config'
package main import "fmt" type CustomError struct { Message string } func (e *CustomError) Error() string { return e.Message } func main() { fmt.Println(parent() == nil) } func parent() error { return child() } func child() *CustomError { return nil }
https://go.dev/play/p/AYl4dQpc2pm
I expect the result of the parent() function to equal nil.
parent()
nil
I expect the result of the parent() function to equal nil. If the child() function' return type is set to error, it will work fine.
child()
error
The text was updated successfully, but these errors were encountered:
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Sorry, something went wrong.
No branches or pull requests
Go version
go version go1.23.0 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
https://go.dev/play/p/AYl4dQpc2pm
What did you see happen?
I expect the result of the
parent()
function to equalnil
.What did you expect to see?
I expect the result of the
parent()
function to equalnil
.If the
child()
function' return type is set toerror
, it will work fine.The text was updated successfully, but these errors were encountered: