matcher.go
func (f RuneMatcherFunc) Match(str string) (offset int, matchStr string) {
	offset = -1
	length := len(str)
	if length == 0 {
		return
	}

	for i, r := range str {
		if f(r) {
			continue
		}
		if i != 0 {
			offset = i
			matchStr = str[:i]
			return
		}
		return
	}

	offset = length
	matchStr = str
	return
}
func (f RuneMatcherFunc) Match(str string) (offset int, matchStr string) {
	offset = -1
	length := len(str)
	if length == 0 {
		return
	}

	for i, r := range str {
		if f(r) {
			continue
		}
		if i != 0 {
			offset = i
			matchStr = str[:i]
			return
		}
		return
	}

	offset = length
	matchStr = str
	return
}
func ( f RuneMatcherFunc ) Match ( str string ) ( offset int , matchStr string ) { offset = - 1 length := len ( str ) if length == 0 { return } for i , r := range str { if f ( r ) { continue } if i != 0 { offset = i matchStr = str [ : i ] return } return } offset = length matchStr = str return }
// Match processes the given string until it encounters a rune that doesn't
// match.
Match processes the given string until it encounters a rune that doesn t match .