containerIdxFromAddr extracts the numeric suffix from the "zeroN" segment of a member's address and returns it as the container index used by tests.
(addr string)
| 214 | // containerIdxFromAddr extracts the numeric suffix from the "zeroN" segment |
| 215 | // of a member's address and returns it as the container index used by tests. |
| 216 | func containerIdxFromAddr(addr string) (int, bool) { |
| 217 | for i := range maxContainerIdxScan { |
| 218 | if strings.Contains(addr, fmt.Sprintf("zero%d", i)) { |
| 219 | return i, true |
| 220 | } |
| 221 | } |
| 222 | return -1, false |
| 223 | } |
| 224 | |
| 225 | // maxContainerIdxScan bounds the zero N scan in containerIdxFromAddr. It is |
| 226 | // larger than any realistic test topology. |
no outgoing calls
no test coverage detected