Each calls the given function for each service in the map. An error from fn will stop the iteration and be returned as-is.
(fn func(K, S) error)
| 121 | // Each calls the given function for each service in the map. An error from |
| 122 | // fn will stop the iteration and be returned as-is. |
| 123 | func (s *serviceMap[K, S]) Each(fn func(K, S) error) error { |
| 124 | for key, svc := range s.services { |
| 125 | if err := fn(key, svc); err != nil { |
| 126 | return err |
| 127 | } |
| 128 | } |
| 129 | return nil |
| 130 | } |
| 131 | |
| 132 | // Suture implementation |
| 133 |
no outgoing calls