]> Cypherpunks repositories - gostls13.git/commitdiff
net: clarify that conn.LocalAddr and conn.RemoteAddr might not be known
authorBryan C. Mills <bcmills@google.com>
Fri, 3 Dec 2021 22:09:06 +0000 (17:09 -0500)
committerBryan Mills <bcmills@google.com>
Mon, 6 Dec 2021 22:36:22 +0000 (22:36 +0000)
For #34611

Change-Id: I9a1357f53124c98ad017b58774696d0377dbea27
Reviewed-on: https://go-review.googlesource.com/c/go/+/369160
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/net.go

index ab6aeaac2f64bb0a71cb16a96375c4843c5712ee..77e54a91258e14997615d3fc6e88a27afb58333d 100644 (file)
@@ -125,10 +125,10 @@ type Conn interface {
        // Any blocked Read or Write operations will be unblocked and return errors.
        Close() error
 
-       // LocalAddr returns the local network address.
+       // LocalAddr returns the local network address, if known.
        LocalAddr() Addr
 
-       // RemoteAddr returns the remote network address.
+       // RemoteAddr returns the remote network address, if known.
        RemoteAddr() Addr
 
        // SetDeadline sets the read and write deadlines associated
@@ -328,7 +328,7 @@ type PacketConn interface {
        // Any blocked ReadFrom or WriteTo operations will be unblocked and return errors.
        Close() error
 
-       // LocalAddr returns the local network address.
+       // LocalAddr returns the local network address, if known.
        LocalAddr() Addr
 
        // SetDeadline sets the read and write deadlines associated