tree.go
func getRawPattern(rawPattern string) string {
	rawPattern = strings.Replace(rawPattern, ":int", "", -1)
	rawPattern = strings.Replace(rawPattern, ":string", "", -1)

	for {
		startIdx := strings.Index(rawPattern, "(")
		if startIdx == -1 {
			break
		}

		closeIdx := strings.Index(rawPattern, ")")
		if closeIdx > -1 {
			rawPattern = rawPattern[:startIdx] + rawPattern[closeIdx+1:]
		}
	}
	return rawPattern
}
func getRawPattern(rawPattern string) string {
	rawPattern = strings.Replace(rawPattern, ":int", "", -1)
	rawPattern = strings.Replace(rawPattern, ":string", "", -1)

	for {
		startIdx := strings.Index(rawPattern, "(")
		if startIdx == -1 {
			break
		}

		closeIdx := strings.Index(rawPattern, ")")
		if closeIdx > -1 {
			rawPattern = rawPattern[:startIdx] + rawPattern[closeIdx+1:]
		}
	}
	return rawPattern
}
func getRawPattern ( rawPattern string ) string { rawPattern = strings . Replace ( rawPattern , " " , " " , - 1 ) rawPattern = strings . Replace ( rawPattern , " " , " " , - 1 ) for { startIdx := strings . Index ( rawPattern , " " ) if startIdx == - 1 { break } closeIdx := strings . Index ( rawPattern , " " ) if closeIdx > - 1 { rawPattern = rawPattern [ : startIdx ] + rawPattern [ closeIdx + 1 : ] } } return rawPattern }
// getRawPattern removes all regexp but keeps wildcards for building URL path.
getRawPattern removes all regexp but keeps wildcards for building URL path .