diff options
author | Runxi Yu <me@runxiyu.org> | 2024-12-08 21:34:30 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2024-12-08 21:34:30 +0800 |
commit | f86032e68213087b8f087245851b915b5f6acfa6 (patch) | |
tree | 33e617793050e7ed25a914a70da43e33f5ba4650 /servers.go | |
parent | UID -> CID (diff) | |
download | meseircd-f86032e68213087b8f087245851b915b5f6acfa6.tar.gz meseircd-f86032e68213087b8f087245851b915b5f6acfa6.tar.zst meseircd-f86032e68213087b8f087245851b915b5f6acfa6.zip |
Server & Client should only have pointer receivers
Diffstat (limited to 'servers.go')
-rw-r--r-- | servers.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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 |