code: func (o Options) Connect() (*Conn, error) {
  	nc := &Conn{Opts: o}
  
  	// Some default options processing.
  	if nc.Opts.MaxPingsOut == 0 {
  		nc.Opts.MaxPingsOut = DefaultMaxPingOut
  	}
  	// Allow old default for channel length to work correctly.
  	if nc.Opts.SubChanLen == 0 {
  		nc.Opts.SubChanLen = DefaultMaxChanLen
  	}
  	// Default ReconnectBufSize
  	if nc.Opts.ReconnectBufSize == 0 {
  		nc.Opts.ReconnectBufSize = DefaultReconnectBufSize
  	}
  	// Ensure that Timeout is not 0
  	if nc.Opts.Timeout == 0 {
  		nc.Opts.Timeout = DefaultTimeout
  	}
  
  	// Check first for user jwt callback being defined and nkey.
  	if nc.Opts.UserJWT != nil && nc.Opts.Nkey != "" {
  		return nil, ErrNkeyAndUser
  	}
  
  	// Check if we have an nkey but no signature callback defined.
  	if nc.Opts.Nkey != "" && nc.Opts.SignatureCB == nil {
  		return nil, ErrNkeyButNoSigCB
  	}
  
  	// Allow custom Dialer for connecting using DialTimeout by default
  	if nc.Opts.Dialer == nil {
  		nc.Opts.Dialer = &net.Dialer{
  			Timeout: nc.Opts.Timeout,
  		}
  	}
  
  	if err := nc.setupServerPool(); err != nil {
  		return nil, err
  	}
  
  	// Create the async callback handler.
  	nc.ach = &asyncCallbacksHandler{}
  	nc.ach.cond = sync.NewCond(&nc.ach.mu)
  
  	if err := nc.connect(); err != nil {
  		return nil, err
  	}
  
  	// Spin up the async cb dispatcher on success
  	go nc.ach.asyncCBDispatcher()
  
  	return nc, nil
  }
docs: // Connect will attempt to connect to a NATS server with multiple options.