Chore: update dependencies & fix typo

This commit is contained in:
Dreamacro
2019-06-29 16:48:48 +08:00
parent 57fdd223f1
commit 34338e7107
5 changed files with 21 additions and 20 deletions

View File

@ -6,7 +6,7 @@ import (
)
var (
errIPNotFound = errors.New("ip not found")
errIPNotFound = errors.New("cannot found ip")
)
// ResolveIP with a host, return ip

View File

@ -77,7 +77,7 @@ func (r *Resolver) ResolveIP(host string) (ip net.IP, err error) {
ip, open := <-ch
if !open {
return nil, errors.New("can't found ip")
return nil, errIPNotFound
}
return ip, nil
@ -100,7 +100,7 @@ func (r *Resolver) ResolveIPv4(host string) (ip net.IP, err error) {
ips := r.msgToIP(msg)
if len(ips) == 0 {
return nil, errors.New("can't found ip")
return nil, errIPNotFound
}
ip = ips[0]
@ -207,7 +207,7 @@ func (r *Resolver) fallbackExchange(m *D.Msg) (msg *D.Msg, err error) {
res := <-msgCh
if res.Error == nil {
if mmdb == nil {
return nil, errors.New("GeoIP can't use")
return nil, errors.New("GeoIP cannot use")
}
if ips := r.msgToIP(res.Msg); len(ips) != 0 {
@ -236,7 +236,7 @@ func (r *Resolver) resolveIP(host string, dnsType uint16) (ip net.IP, err error)
ips := r.msgToIP(msg)
if len(ips) == 0 {
return nil, errors.New("can't found ip")
return nil, errIPNotFound
}
ip = ips[0]