code: func (h *BasicHost) dialPeer(ctx context.Context, p peer.ID) error {
  	log.Debugf("host %s dialing %s", h.ID(), p)
  	c, err := h.Network().DialPeer(ctx, p)
  	if err != nil {
  		return err
  	}
  
  	// Clear protocols on connecting to new peer to avoid issues caused
  	// by misremembering protocols between reconnects
  	h.Peerstore().SetProtocols(p)
  
  	// identify the connection before returning.
  	done := make(chan struct{})
  	go func() {
  		h.ids.IdentifyConn(c)
  		close(done)
  	}()
  
  	// respect don contexteone
  	select {
  	case <-done:
  	case <-ctx.Done():
  		return ctx.Err()
  	}
  
  	log.Debugf("host %s finished dialing %s", h.ID(), p)
  	return nil
  }
docs: // dialPeer opens a connection to peer, and makes sure to identify
  // the connection once it has been opened.