6
84
Fork
You've already forked dns
39

Documentation update on the behavior of WriteTo #299

Merged
miekg merged 1 commit from wrouesnel/dns:wrouesnel/documentation_update into main 2025年10月10日 11:16:18 +02:00
Contributor
Copy link

WriteTo implies that the behavior of net.Conn is only altered when a *net.TCPConn is the underlying type of w.

However the implementation is actually a specialization for *net.UDPConn. This difference means in cases where net.Conn may be neither (i.e. is nil, or a different type) then the TCP behavior applies and must be accounted for.

This is minor but I lost an hour being very confused about what was happening before discovering this, and the documentation update reflects the real situation.

WriteTo implies that the behavior of net.Conn is only altered when a `*net.TCPConn` is the underlying type of w. However the implementation is actually a specialization for *net.UDPConn. This difference means in cases where net.Conn may be neither (i.e. is nil, or a different type) then the TCP behavior applies and must be accounted for. This is minor but I lost an hour being very confused about what was happening before discovering this, and the documentation update reflects the real situation.
Documentation update on the behavior of WriteTo
Some checks are pending
ci/woodpecker/pr/build Pipeline is pending approval
ci/woodpecker/pull_request_closed/build Pipeline is pending approval
89bb871daa
WriteTo implies that the behavior of net.Conn is
only altered when a *net.TCPConn is the underlying
type of w.
However the implementation is actually a specialization
for *net.UDPConn. This difference means in cases where
net.Conn may be neither (i.e. is nil, or a different type)
then the TCP behavior applies and must be accounted for.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
miekg/dns!299
Reference in a new issue
miekg/dns
No description provided.
Delete branch "wrouesnel/dns:wrouesnel/documentation_update"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?