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:
@@ -83,7 +83,7 @@ func (widget *Widget) display() {
|
||||
func (widget *Widget) contentFrom(messages []Message) string {
|
||||
var str string
|
||||
for idx, message := range messages {
|
||||
str = str + fmt.Sprintf(
|
||||
str += fmt.Sprintf(
|
||||
`["%d"][%s] [blue]%s [lightslategray]%s: [%s]%s [aqua]%s[""]`,
|
||||
idx,
|
||||
widget.RowColor(idx),
|
||||
@@ -94,7 +94,7 @@ func (widget *Widget) contentFrom(messages []Message) string {
|
||||
message.Sent.Format("Jan 02, 15:04 MST"),
|
||||
)
|
||||
|
||||
str = str + "\n"
|
||||
str += "\n"
|
||||
}
|
||||
|
||||
return str
|
||||
|
||||
Reference in New Issue
Block a user