From f86032e68213087b8f087245851b915b5f6acfa6 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sun, 8 Dec 2024 21:34:30 +0800 Subject: Server & Client should only have pointer receivers --- servers.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'servers.go') diff --git a/servers.go b/servers.go index 4cc8b31..f9dd319 100644 --- a/servers.go +++ b/servers.go @@ -16,7 +16,7 @@ func (server *Server) Send(msg SMsg) error { } func (server *Server) SendRaw(s string) error { - if server == &self { + if server == self { return ErrSendToSelf } if server.conn == nil { @@ -34,12 +34,12 @@ func (server *Server) SendRaw(s string) error { return nil } -func (server Server) ClientSource() string { +func (server *Server) ClientSource() string { return server.Name } -func (server Server) ServerSource() string { +func (server *Server) ServerSource() string { return server.SID } -var self Server +var self *Server -- cgit v1.2.3