func (ss *ServerList) Each(f func(net.Addr) error) error {
	// As we need to take the lock inside PickServers, make a stable slice of attrs (otherwise
	// we'd deadlock).
	// If changes are made to the code that means the underlying array for addrs could be
	// mutated this should become a copy
	ss.mu.RLock()
	addrs := ss.addrs[:]
	ss.mu.RUnlock()
	for _, a := range addrs {
		if err := f(a); nil != err {
			return err
		}
	}
	return nil
}
// Each iterates over each server, regardless of current availability
Each iterates over each server, regardless of current availability
// Each iterates over each server regardless of current availability
func (ss *ServerList) Each(f func(net.Addr) error) error {
	ss.mu.RLock()
	addrs := ss.addrs[:]
	ss.mu.RUnlock()
	for _, a := range addrs {
		if err := f(a); nil != err {
			return err
		}
	}
	return nil
}
func ( ss * ServerList ) Each ( f func ( net . Addr ) error ) error { ss . mu . RLock ( ) addrs := ss . addrs [ : ] ss . mu . RUnlock ( ) for _ , a := range addrs { if err := f ( a ) ; nil != err { return err } } return nil }
Each iterates over each server, regardless of current availability
Each iterates over each server regardless of current availability
// As we need to take the lock inside PickServers, make a stable slice of attrs (otherwise // we'd deadlock). // If changes are made to the code that means the underlying array for addrs could be // mutated this should become a copy