From 813d9ea524e4d75ef2e4aaa358e8b45ac8b3547c Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 20 Oct 2024 17:39:31 -0700 Subject: [PATCH] net: document ctx argument to ListenConfig.Listen/ListenPacket Change-Id: I351b88276307c8d21e43b5b992b30b64996d129c Reviewed-on: https://go-review.googlesource.com/c/go/+/620777 Auto-Submit: Ian Lance Taylor LUCI-TryBot-Result: Go LUCI Reviewed-by: Ian Lance Taylor Reviewed-by: Damien Neil Auto-Submit: Ian Lance Taylor Commit-Queue: Ian Lance Taylor --- src/net/dial.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/net/dial.go b/src/net/dial.go index 3098d35b42..db0404c3f8 100644 --- a/src/net/dial.go +++ b/src/net/dial.go @@ -798,6 +798,9 @@ func (lc *ListenConfig) SetMultipathTCP(use bool) { // // See func Listen for a description of the network and address // parameters. +// +// The ctx argument is used while resolving the address on which to listen; +// it does not affect the returned Listener. func (lc *ListenConfig) Listen(ctx context.Context, network, address string) (Listener, error) { addrs, err := DefaultResolver.resolveAddrList(ctx, "listen", network, address, nil) if err != nil { @@ -832,6 +835,9 @@ func (lc *ListenConfig) Listen(ctx context.Context, network, address string) (Li // // See func ListenPacket for a description of the network and address // parameters. +// +// The ctx argument is used while resolving the address on which to listen; +// it does not affect the returned Listener. func (lc *ListenConfig) ListenPacket(ctx context.Context, network, address string) (PacketConn, error) { addrs, err := DefaultResolver.resolveAddrList(ctx, "listen", network, address, nil) if err != nil { -- 2.48.1