-
Notifications
You must be signed in to change notification settings - Fork 17.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
net: “Name Resolution” documentation does not describe default behavior on Windows #57663
Comments
That line was changed to the past tense in CL 409234 (attn @bradfitz @ianlancetaylor). It does seem to have dropped the description of the default behavior on Windows. 😅 |
If I understand #33097 correctly, on Windows the resolver still defaults to those C library functions, but can be overridden to a pure-Go implementation by setting |
The behavior on 1.19 and above is the behavior described in the lengthy comment for which that sentence is the last paragraph. Any suggestions on how to make that clearer? |
I think that we should mention than windows (by default) regardless of the |
Note that that is true on other systems at all, such as Darwin. |
I'd like to tackle this if it's a good first issue. How should the doc read for net.go to account for default behavior in Windows/Darwin/etc.? |
I think there are two points here. The first is that the final sentence in the comment suggests that we have failed to document the behavior of Go 1.19 and later on Windows. We should perhaps somehow indicate that the rest of the comment applies. The second is a point that the comment currently doesn't mention at all. When cgo is not supported (because Any changes here need to be both precise and terse. We do not want several sentences discussing these unusual situations. Thanks. |
I think part of the problem is that the second paragraph begins with “On Unix systems,” and the third paragraph seems to only clarify what came before it. So the third paragraph reads as though it applies only to Unix. But, it seems to me that that paragraph still doesn't apply to Windows. The build constraint in From what I understand from reading the code, the behavior seems to be:
|
@bcmills Thanks! I have some text changes I'd like to get feedback on, but I think I have all the points covered. Between the first and second paragraphs, I'm adding: The third paragraph "On Unix..." is unchanged as well as the long description following it. I added this paragraph after the description: I can submit a PR for the changes, but just wanted to get some feedback on the text before I commit what I have. Thanks again! |
Change https://go.dev/cl/477155 mentions this issue: |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes:
go/src/net/net.go
Line 76 in f721fa3
What operating system and processor architecture are you using (
go env
)?go env
Output(GONOPROXY and related redacted for privacy)
What did you do?
I was reading the net/ docs to try to understand some details around DoT/DoH, and came across this statement:
On Windows, in Go 1.18.x and earlier, the resolver always used C library functions, such as GetAddrInfo and DnsQuery.
This statement is somewhat confusing, as it is not clear how it pertains to my current Go version 1.19.3.
What did you expect to see?
I would prefer to see a statement that describes the behavior of my Go version.
What did you see instead?
I saw a statement that describes past versions only.
The text was updated successfully, but these errors were encountered: