exit script if connection to api is failed

This commit is contained in:
arnaucode
2017-05-11 15:44:01 +02:00
parent 9834404c05
commit 4c15739249
5 changed files with 12 additions and 3 deletions

View File

@@ -89,11 +89,12 @@ func analyzeHours(tweets []twitter.Tweet) {
for _, v := range tweets {
time := strings.Split(v.CreatedAt, " ")[3]
hour := strings.Split(time, ":")[0]
if _, ok := hours[hour]; ok {
/*if _, ok := hours[hour]; ok {
hours[hour] = hours[hour] + 1
} else {
hours[hour] = 1
}
}*/
hours[hour]++
}
printHours(hours)
}