1
0
Fork 0
mirror of https://github.com/fluffle/goirc synced 2025-07-17 09:11:13 +00:00

Ditch initialise() functions and just make constructors better.

This commit is contained in:
Alex Bramley 2011-10-13 22:48:04 +01:00
parent 6266eba245
commit 2c333e0e9a
3 changed files with 22 additions and 22 deletions

View file

@ -90,9 +90,12 @@ func init() {
* Channel methods for state management
\******************************************************************************/
func (ch *Channel) initialise() {
ch.Modes = new(ChanMode)
ch.nicks = make(map[*Nick]*ChanPrivs)
func NewChannel(name string) *Channel {
return &Channel{
Name: name,
Modes: new(ChanMode),
nicks: make(map[*Nick]*ChanPrivs),
}
}
// Associates a Nick with a Channel using a shared set of ChanPrivs