1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Some code improvements

* Some assignments simplified by using assignment operators
* Rewrite switch statement with only one case as if.
* Rewrite if-else chain as a switch statement.
* go fmt `modules/todoist/project.go` file.
This commit is contained in:
Kirill Motkov
2019-05-21 17:17:47 +03:00
parent c050292a8d
commit f0771cd013
46 changed files with 161 additions and 168 deletions

View File

@@ -26,7 +26,7 @@ func GetCards(client *trello.Client, username string, boardName string, lists ma
return nil, err
}
searchResult.Total = searchResult.Total + len(cards)
searchResult.Total += len(cards)
cardArray := make([]TrelloCard, 0)
for _, card := range cards {

View File

@@ -67,10 +67,10 @@ func (widget *Widget) contentFrom(searchResult *SearchResult) string {
str := ""
for list, cardArray := range searchResult.TrelloCards {
str = str + fmt.Sprintf(" [red]%s[white]\n", list)
str += fmt.Sprintf(" [red]%s[white]\n", list)
for _, card := range cardArray {
str = str + fmt.Sprintf(" %s[white]\n", card.Name)
str += fmt.Sprintf(" %s[white]\n", card.Name)
}
str = fmt.Sprintf("%s\n", str)
}