INNER CODE UNIT · Go
buildReport
tducasse/go-instabot · util.go:220
func buildReport() {
reportAsString := ""
for index, element := range report {
var times string
if element == 1 {
times = "time"
} else {
times = "times"
}
if index.Action == "like" {
reportAsString += fmt.Sprintf("#%s has been liked %d %s\n", index.Tag, element, times)
} else {
reportAsString += fmt.Sprintf("#%s has been %sed %d %s\n", index.Tag, index.Action, element, times)
}
}
// Displays the report on the screen / log file
fmt.Println(reportAsString)