code: func Client(cfg *Config) *Conn {
  	if cfg == nil {
  		cfg = NewConfig("__idiot__")
  	}
  	if cfg.Me == nil || cfg.Me.Nick == "" || cfg.Me.Ident == "" {
  		cfg.Me = &state.Nick{Nick: "__idiot__"}
  		cfg.Me.Ident = "goirc"
  		cfg.Me.Name = "Powered by GoIRC"
  	}
  
  	dialer := new(net.Dialer)
  	dialer.Timeout = cfg.Timeout
  	dialer.DualStack = cfg.DualStack
  	if cfg.LocalAddr != "" {
  		if !hasPort(cfg.LocalAddr) {
  			cfg.LocalAddr += ":0"
  		}
  
  		local, err := net.ResolveTCPAddr("tcp", cfg.LocalAddr)
  		if err == nil {
  			dialer.LocalAddr = local
  		} else {
  			logging.Error("irc.Client(): Cannot resolve local address %s: %s", cfg.LocalAddr, err)
  		}
  	}
  
  	conn := &Conn{
  		cfg:         cfg,
  		dialer:      dialer,
  		intHandlers: handlerSet(),
  		fgHandlers:  handlerSet(),
  		bgHandlers:  handlerSet(),
  		stRemovers:  make([]Remover, 0, len(stHandlers)),
  		lastsent:    time.Now(),
  	}
  	conn.addIntHandlers()
  	return conn
  }
docs: // Client takes a Config struct and returns a new Conn ready to have
  // handlers added and connect to a server.