Files
Erupe/cmd/protbot/scenario/logout.go
Houmgaor e899a2f790 style: check error returns flagged by errcheck linter
golangci-lint's errcheck rule requires explicit handling of error
return values from Close, Write, and Logout calls. Use blank
identifier assignment for cleanup paths where errors are
intentionally discarded.
2026-02-20 21:22:01 +01:00

18 lines
388 B
Go

package scenario
import (
"fmt"
"erupe-ce/cmd/protbot/protocol"
)
// Logout sends MSG_SYS_LOGOUT and closes the channel connection.
func Logout(ch *protocol.ChannelConn) error {
fmt.Println("[logout] Sending MSG_SYS_LOGOUT...")
if err := ch.SendPacket(protocol.BuildLogoutPacket()); err != nil {
_ = ch.Close()
return fmt.Errorf("logout send: %w", err)
}
return ch.Close()
}