1
0
mirror of https://github.com/golang/go synced 2024-11-26 19:41:19 -07:00

don't use math pacakage

This commit is contained in:
Mateusz Poliwczak 2022-12-01 18:54:18 +01:00
parent 4ca908c746
commit 488cd3ed0d

View File

@ -14,7 +14,6 @@ package net
import (
"context"
"errors"
"math"
"syscall"
"unsafe"
@ -356,7 +355,7 @@ func resSearch(ctx context.Context, hostname string, rtype, class int) ([]dnsmes
for {
size, _ := _C_res_nsearch(state, s, class, rtype, buf, bufSize)
if size <= 0 || size > math.MaxUint16 {
if size <= 0 || size > 0xffff {
return nil, errors.New("res_nsearch failure")
}
if size <= bufSize {