Make go vet happy

master
HimbeerserverDE 2022-04-21 13:21:15 +02:00
parent a43b511fbe
commit 6381e1efbc
No known key found for this signature in database
GPG Key ID: A3D3E205DA0B0401
4 changed files with 3 additions and 6 deletions

View File

@ -146,7 +146,6 @@ func (a authFiles) Unban(id string) error {
if string(name) == id {
return os.Remove(Path("ban/", f.Name()))
break
}
}
}

View File

@ -20,7 +20,7 @@ func (cc *ClientConn) SendChatMsg(msg ...string) {
// Colorize returns the minetest-colorized version of the input.
func Colorize(text, color string) string {
return string(0x1b) + "(c@" + color + ")" + text + string(0x1b) + "(c@#FFF)"
return string([]rune{0x1b}) + "(c@" + color + ")" + text + string([]rune{0x1b}) + "(c@#FFF)"
}
func onChatMsg(cc *ClientConn, cmd *mt.ToSrvChatMsg) (string, bool) {

View File

@ -105,8 +105,6 @@ func FallbackServers(server string) []string {
} else {
return append(fallbacks, conf.FallbackServers...)
}
return fallbacks
}
// LoadConfig attempts to parse the configuration file.

View File

@ -539,10 +539,10 @@ func (sc *ServerConn) process(pkt mt.Pkt) {
case *mt.ToCltKick:
sc.Log("<-", "deny access", cmd)
if cmd.Reason == mt.Shutdown || cmd.Reason == mt.Crash || cmd.Reason == mt.SrvErr || cmd.Reason == cmd.TooManyClts || cmd.Reason == cmd.UnsupportedVer {
if cmd.Reason == mt.Shutdown || cmd.Reason == mt.Crash || cmd.Reason == mt.SrvErr || cmd.Reason == mt.TooManyClts || cmd.Reason == mt.UnsupportedVer {
clt.SendChatMsg(cmd.String())
for _, srvName := range FallbackServers(sc.name) {
if err := clt.Hop(); err != nil {
if err := clt.Hop(srvName); err != nil {
clt.Log("<-", err)
break
}