avoid empty strings

This commit is contained in:
Ted Unangst 2020-02-25 13:29:09 -05:00
parent 5af0737506
commit 0b38c46d37
1 changed files with 3 additions and 0 deletions

3
fun.go
View File

@ -298,6 +298,9 @@ func grapevine(mentions []Mention) []string {
func grapeape(s string) []Mention { func grapeape(s string) []Mention {
var mentions []Mention var mentions []Mention
for _, m := range strings.Split(s, " ") { for _, m := range strings.Split(s, " ") {
if m == "" {
continue
}
where := gofish(m) where := gofish(m)
if where != "" { if where != "" {
mentions = append(mentions, Mention{Who: m, Where: where}) mentions = append(mentions, Mention{Who: m, Where: where})