net/dnscache: don't use the Go resolver on Android

The local resolver is not available for apps on Android.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
reviewable/pr332/r1
Elias Naur 2020-04-27 20:24:53 +02:00 committed by Brad Fitzpatrick
parent a464439658
commit ad0795efc2
1 changed files with 5 additions and 0 deletions

View File

@ -31,6 +31,11 @@ func preferGoResolver() bool {
return false
}
// The local resolver is not available on Android.
if runtime.GOOS == "android" {
return false
}
// Otherwise, the Go resolver is fine and slightly preferred
// since it's lighter, not using cgo calls & threads.
return true