code: func BastionConnectFunc(
  	bProto string,
  	bAddr string,
  	bConf *ssh.ClientConfig,
  	proto string,
  	addr string) func() (net.Conn, error) {
  	return func() (net.Conn, error) {
  		log.Printf("[DEBUG] Connecting to bastion: %s", bAddr)
  		bastion, err := ssh.Dial(bProto, bAddr, bConf)
  		if err != nil {
  			return nil, fmt.Errorf("Error connecting to bastion: %s", err)
  		}
  
  		log.Printf("[DEBUG] Connecting via bastion (%s) to host: %s", bAddr, addr)
  		conn, err := bastion.Dial(proto, addr)
  		if err != nil {
  			bastion.Close()
  			return nil, err
  		}
  
  		// Wrap it up so we close both things properly
  		return &bastionConn{
  			Conn:    conn,
  			Bastion: bastion,
  		}, nil
  	}
  }
docs: // BastionConnectFunc is a convenience method for returning a function
  // that connects to a host over a bastion connection.