You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When GODEBUG=netdns=go or Resolver.PreferGo is true, DefaultResolver.Lookup{IPAddr,Host} and LookupHost fail to parse a literal IPv6 address w/ zone like the following:
% go run x.go
lookup fe80::1%lo0: no such host
exit status 1
--
package main
import (
"context"
"log"
"net"
)
func main() {
r := &net.Resolver{PreferGo: true}
ipas, err := r.LookupIPAddr(context.Background(), "fe80::1%lo0")
if err != nil {
log.Fatal(err)
}
log.Println(ipas)
}
Hope this is the last one of long standing issues regarding inconsistency between GODEBUG=netdns=cgo and GODEBUG=netdns=go. The fix would be simply to replace the use of ParseIP with a pair of parseIPv4 and parseIPv6, so this is probably a good first contribution issue.