1
0
mirror of https://github.com/thebaer/tildes.git synced 2018-07-20 07:15:21 +00:00

Fix whitespace in where

This commit is contained in:
Matt Baer 2015-02-11 23:40:52 -05:00
parent dca3c0131a
commit b559a01fd6

View File

@ -109,17 +109,17 @@ func getTimeInZone(tz string) string {
func getGeo(u *User) {
fmt.Printf("Fetching %s location...\n", u.Name)
response, err := http.Get(fmt.Sprintf("https://freegeoip.net/json/%s", u.IP))
if err != nil {
fmt.Printf("%s", err)
os.Exit(1)
} else {
defer response.Body.Close()
contents, err := ioutil.ReadAll(response.Body)
if err != nil {
fmt.Printf("%s", err)
os.Exit(1)
}
response, err := http.Get(fmt.Sprintf("https://freegeoip.net/json/%s", u.IP))
if err != nil {
fmt.Printf("%s", err)
os.Exit(1)
} else {
defer response.Body.Close()
contents, err := ioutil.ReadAll(response.Body)
if err != nil {
fmt.Printf("%s", err)
os.Exit(1)
}
var dat map[string]interface{}
@ -133,7 +133,7 @@ func getGeo(u *User) {
u.CurrentTime = getTimeInZone(dat["time_zone"].(string))
u.Region = region
u.Country = country
}
}
}
func prettyLocation(region, country string) string {