code: func getPoolByListenerID(client *gophercloud.ServiceClient, loadbalancerID string, listenerID string) (*v2pools.Pool, error) {
  	listenerPools := make([]v2pools.Pool, 0, 1)
  	err := v2pools.List(client, v2pools.ListOpts{LoadbalancerID: loadbalancerID}).EachPage(func(page pagination.Page) (bool, error) {
  		poolsList, err := v2pools.ExtractPools(page)
  		if err != nil {
  			return false, err
  		}
  		for _, p := range poolsList {
  			for _, l := range p.Listeners {
  				if l.ID == listenerID {
  					listenerPools = append(listenerPools, p)
  				}
  			}
  		}
  		if len(listenerPools) > 1 {
  			return false, ErrMultipleResults
  		}
  		return true, nil
  	})
  	if err != nil {
  		if isNotFound(err) {
  			return nil, ErrNotFound
  		}
  		return nil, err
  	}
  
  	if len(listenerPools) == 0 {
  		return nil, ErrNotFound
  	} else if len(listenerPools) > 1 {
  		return nil, ErrMultipleResults
  	}
  
  	return &listenerPools[0], nil
  }
docs: // Get pool for a listener. A listener always has exactly one pool.