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

net: unnecessary code in net/tcpsock.go #8157

Closed
gopherbot opened this issue Jun 6, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@gopherbot
Copy link

commented Jun 6, 2014

by deafwolfdruid:

in net/tcpsock.go

func (a *TCPAddr) toAddr() Addr {
    if a == nil {
        return nil
    }
    return a
}

Is the "if" condition necessary?
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2014

Comment 1:

Yes.  http://golang.org/doc/faq#nil_error

Status changed to WorkingAsIntended.

@gopherbot

This comment has been minimized.

Copy link
Author

commented Jun 9, 2014

Comment 2 by deafwolfdruid:

thanks

@golang golang locked and limited conversation to collaborators Jun 25, 2016

This issue was closed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.