mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-19 10:17:41 +03:00
chat: Use strings.Builder
This commit is contained in:
parent
7b06848c75
commit
953c3d46b2
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user