// smartCase returns a matcherFunc that is case-sensitive if q contains any
// upper-case characters, and case-insensitive otherwise.
smartCase returns a matcherFunc that is case-sensitive if q contains any
upper-case characters, and case-insensitive otherwise.
// smartCase returns a matcherFunc that is case - sensitive if q contains any // upper - case characters and case - insensitive otherwise .
func smartCase(q string, m matcherFunc) matcherFunc {
	insensitive := strings.ToLower(q) == q
	wrapper := []string{""}
	return func(chunks []string) (int, float64) {
		s := strings.Join(chunks, "")
		if insensitive {
			s = strings.ToLower(s)
		}
		wrapper[0] = s
		return m(wrapper)
	}
}
func smartCase ( q string , m matcherFunc ) matcherFunc { insensitive := strings . ToLower ( q ) == q wrapper := [ ] string { " " } return func ( chunks [ ] string ) ( int , float64 ) { s := strings . Join ( chunks , " " ) if insensitive { s = strings . ToLower ( s ) } wrapper [ 0 ] = s return m ( wrapper ) } }
smartCase returns a matcherFunc that is case-sensitive if q contains any
upper-case characters, and case-insensitive otherwise.
smartCase returns a matcherFunc that is case - sensitive if q contains any upper - case characters and case - insensitive otherwise .