Go version
go1.24.5 linux/amd64
Output of go env
in your module/workspace:
-
What did you do?
I looked at the doc comment of (*ListenConfig).ListenPacket
What did you see happen?
and saw, it said:
// 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) {
(Cf. https://cs.opensource.google/go/go/+/refs/tags/go1.24.5:src/net/dial.go;l=839-840 [2025-07-15])
What did you expect to see?
I think it should say "... does not affect the returned PacketConn.".
Looking at the blame, it appears to be an overzealously symmetric doc comment to (*ListenConfig).Listen: cf. https://cs.opensource.google/go/go/+/refs/tags/go1.24.5:src/net/dial.go;l=841;bpv=1;bpt=0;drc=813d9ea524e4d75ef2e4aaa358e8b45ac8b3547c;dlc=8e478de4e6c91a0de763cf2e308f7598677f5c58 [2025-07-15]
As of 75a19dbcd7e69dc619fd57b9ed32f697121160ba, the doc comment appears untouched.
Comment From: cherrymui
Good catch! Would you mind sending a CL? Thanks.