X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=client.go;h=2c8c0ad6721fb04a828029329a0ab607d74beef3;hb=236377e360e37e16986588a62101926d70ad3489;hp=e90d51220fee0eca4ab9d3d64ae0eef07a730ccb;hpb=491e6602aa27f2266c8bc2c6d009b8cd658f440e;p=goircd.git diff --git a/client.go b/client.go index e90d512..2c8c0ad 100644 --- a/client.go +++ b/client.go @@ -1,11 +1,10 @@ /* goircd -- minimalistic simple Internet Relay Chat (IRC) server -Copyright (C) 2014-2016 Sergey Matveev +Copyright (C) 2014-2020 Sergey Matveev This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +the Free Software Foundation, version 3 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -51,7 +50,7 @@ type Client struct { sync.Mutex } -func (c Client) Host() string { +func (c *Client) Host() string { addr := c.conn.RemoteAddr().String() if host, _, err := net.SplitHostPort(addr); err == nil { addr = host @@ -62,7 +61,7 @@ func (c Client) Host() string { return addr } -func (c Client) String() string { +func (c *Client) String() string { return *c.nickname + "!" + *c.username + "@" + c.Host() }