From 953c3d46b25b472c5fddc75e092bb5d1215769b1 Mon Sep 17 00:00:00 2001 From: Ulisse Mini Date: Sat, 23 Feb 2019 20:28:36 -0500 Subject: [PATCH] chat: Use strings.Builder --- chat/command.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chat/command.go b/chat/command.go index 30ce351..d459fc5 100644 --- a/chat/command.go +++ b/chat/command.go @@ -209,17 +209,17 @@ func InitCommands(c *Commands) { if cfg.Theme != nil { theme = cfg.Theme.ID() } - var output string - output += fmt.Sprintf("Current theme: %s%s", theme, message.Newline) - output += " Themes available: " + var output *strings.Builder + fmt.Fprintf(output, "Current theme: %s%s", theme, message.Newline) + fmt.Fprintf(output, " Themes available: ") for i, t := range message.Themes { - output += t.ID() + output.WriteString(t.ID()) if i < len(message.Themes)-1 { - output += ", " + output.WriteString(", ") } } - room.Send(message.NewSystemMsg(output, user)) + room.Send(message.NewSystemMsg(output.String(), user)) return nil }