(pattern string)
| 753 | } |
| 754 | |
| 755 | func patParamKeys(pattern string) []string { |
| 756 | pat := pattern |
| 757 | paramKeys := []string{} |
| 758 | for { |
| 759 | ptyp, paramKey, _, _, _, e := patNextSegment(pat) |
| 760 | if ptyp == ntStatic { |
| 761 | return paramKeys |
| 762 | } |
| 763 | for i := 0; i < len(paramKeys); i++ { |
| 764 | if paramKeys[i] == paramKey { |
| 765 | panic(fmt.Sprintf("chi: routing pattern '%s' contains duplicate param key, '%s'", pattern, paramKey)) |
| 766 | } |
| 767 | } |
| 768 | paramKeys = append(paramKeys, paramKey) |
| 769 | pat = pat[e:] |
| 770 | } |
| 771 | } |
| 772 | |
| 773 | // longestPrefix finds the length of the shared prefix of two strings |
| 774 | func longestPrefix(k1, k2 string) (i int) { |
no test coverage detected