Each iterates over each server calling the given function
(f func(net.Addr) error)
| 91 | |
| 92 | // Each iterates over each server calling the given function |
| 93 | func (ss *ServerList) Each(f func(net.Addr) error) error { |
| 94 | ss.mu.RLock() |
| 95 | defer ss.mu.RUnlock() |
| 96 | for _, a := range ss.addrs { |
| 97 | if err := f(a); nil != err { |
| 98 | return err |
| 99 | } |
| 100 | } |
| 101 | return nil |
| 102 | } |
| 103 | |
| 104 | // keyBufPool returns []byte buffers for use by PickServer's call to |
| 105 | // crc32.ChecksumIEEE to avoid allocations. (but doesn't avoid the |
nothing calls this directly
no outgoing calls
no test coverage detected