cache: check if finalIps length is 0 and not less than 0

Slice's length will never be below 0.

Signed-off-by: Miguel Ángel Jimeno <miguelangel4b@gmail.com>
This commit is contained in:
Miguel Ángel Jimeno 2020-08-27 17:46:57 +02:00
parent e648a161ac
commit 49869b4d90

View File

@ -39,7 +39,7 @@ func NewDialer(options Options) (DialerFunc, error) {
finalIps = append(finalIps, ip)
}
}
if err != nil || len(finalIps) < 0 {
if err != nil || len(finalIps) == 0 {
return nil, &NoAddressFoundError{}
} // Dial to the IPs finally.
for _, ip := range ips {