From 8ea0ffb84a5807438061d34256448df9948a3809 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 3 Dec 2021 17:09:06 -0500 Subject: [PATCH] net: clarify that conn.LocalAddr and conn.RemoteAddr might not be known For #34611 Change-Id: I9a1357f53124c98ad017b58774696d0377dbea27 Reviewed-on: https://go-review.googlesource.com/c/go/+/369160 Trust: Bryan Mills Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- src/net/net.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/net/net.go b/src/net/net.go index ab6aeaac2f6..77e54a91258 100644 --- a/src/net/net.go +++ b/src/net/net.go @@ -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