diff --git a/aipdw.go b/aipdw.go index 041392d..a20b424 100644 --- a/aipdw.go +++ b/aipdw.go @@ -12,8 +12,8 @@ import ( ) var ( - client = &http.Client{Timeout: 5 * time.Second} - ipCache = &sync.Map{} + ipCache = &sync.Map{} + DefaultHttpClient = &http.Client{Timeout: 5 * time.Second} ) type Body struct { @@ -61,7 +61,7 @@ func QueryIP(sk string, key string, ip string) (result Result, err error) { if err != nil { return } - resp, err := client.Do(req) + resp, err := DefaultHttpClient.Do(req) if err != nil { return }