type routingIndex … type routingIndexKey … func (idx *routingIndex) addPattern(pat *pattern) { … } // possiblyConflictingPatterns calls f on all patterns that might conflict with // pat. If f returns a non-nil error, possiblyConflictingPatterns returns immediately // with that error. // // To be correct, possiblyConflictingPatterns must include all patterns that // might conflict. But it may also include patterns that cannot conflict. // For instance, an implementation that returns all registered patterns is correct. // We use this fact throughout, simplifying the implementation by returning more // patterns that we might need to. func (idx *routingIndex) possiblyConflictingPatterns(pat *pattern, f func(*pattern) error) (err error) { … }