mirror of
https://github.com/shazow/ssh-chat.git
synced 2025-04-13 07:37:17 +03:00
chat: Use a string instead of a bytes.Buffer
This commit is contained in:
parent
9c918676ed
commit
4c968fc966
@ -3,7 +3,6 @@ package chat
|
||||
// FIXME: Would be sweet if we could piggyback on a cli parser or something.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
@ -210,16 +209,17 @@ func InitCommands(c *Commands) {
|
||||
if cfg.Theme != nil {
|
||||
theme = cfg.Theme.ID()
|
||||
}
|
||||
var output bytes.Buffer
|
||||
fmt.Fprintf(&output, "Current theme: %s%s", theme, message.Newline)
|
||||
fmt.Fprintf(&output, " Themes available: ")
|
||||
var output string
|
||||
output += fmt.Sprintf("Current theme: %s%s", theme, message.Newline)
|
||||
output += " Themes available: "
|
||||
|
||||
for i, t := range message.Themes {
|
||||
fmt.Fprintf(&output, t.ID())
|
||||
output += t.ID()
|
||||
if i < len(message.Themes)-1 {
|
||||
fmt.Fprintf(&output, ", ")
|
||||
output += ", "
|
||||
}
|
||||
}
|
||||
room.Send(message.NewSystemMsg(output.String(), user))
|
||||
room.Send(message.NewSystemMsg(output, user))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user