-
-
Notifications
You must be signed in to change notification settings - Fork 405
Closed
Labels
Description
Spotted in tailscale/tailscale@bd0e20f:
func preferGoResolver() bool {
//lint:ignore S1008 disagree; prefer comments
// There does not appear to be a local resolver running
// on iOS, and NetworkExtension is good at isolating DNS.
// So do not use the Go resolver on macOS/iOS.
if runtime.GOOS == "darwin" {
return false
}
// Otherwise, the Go resolver is fine and slightly preferred
// since it's lighter, not using cgo calls & threads.
return true
}
We should not suggest replacing this with return runtime.GOOS != "darwin".
When we fix this, we should handle both comments that are attached to the IfStmt as well as comments attached to the ReturnStmt (and probably loose comments inside the block, too, but hopefully that's less common…)
/cc @bradfitz – you have to yell at me when staticcheck is being wrong :-)
Reactions are currently unavailable