1
0
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:
Timothy 2014-08-20 10:27:46 +08:00
parent 81cfe6ef23
commit f211ac4c0f

View File

@ -14,7 +14,6 @@ import (
func get_currentIP(url string) (string, error) {
response, err := http.Get(url)
defer response.Body.Close()
if err != nil {
fmt.Println("Cannot get IP...")
@ -22,6 +21,8 @@ func get_currentIP(url string) (string, error) {
return "", err
}
defer response.Body.Close()
body, _ := ioutil.ReadAll(response.Body)
return string(body), nil
}