mirror of
https://github.com/taigrr/godns
synced 2025-01-18 04:03:25 -08:00
bug fix for getting current IP.
This commit is contained in:
parent
81cfe6ef23
commit
f211ac4c0f
@ -14,7 +14,6 @@ import (
|
|||||||
|
|
||||||
func get_currentIP(url string) (string, error) {
|
func get_currentIP(url string) (string, error) {
|
||||||
response, err := http.Get(url)
|
response, err := http.Get(url)
|
||||||
defer response.Body.Close()
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Cannot get IP...")
|
fmt.Println("Cannot get IP...")
|
||||||
@ -22,6 +21,8 @@ func get_currentIP(url string) (string, error) {
|
|||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer response.Body.Close()
|
||||||
|
|
||||||
body, _ := ioutil.ReadAll(response.Body)
|
body, _ := ioutil.ReadAll(response.Body)
|
||||||
return string(body), nil
|
return string(body), nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user