entry.go
func (e *Entry) getExecMatch(name string, matcher Matcher) ExecFunc {
	return func(method, urlStr string) (*Route, []string) {
		offset, matchStr := matcher.Match(urlStr)
		if offset == -1 {
			return nil, nil
		}

		// finish parsing
		if len(urlStr) == offset {
			if h := e.GetHandler(method); h != nil {
				return h, []string{name, matchStr}
			}
			return nil, nil
		}

		for _, entry := range e.entries {
			if h, params := entry.exec(method, urlStr[offset:]); h != nil {
				params = append(params, name, matchStr)
				return h, params
			}
		}
		return nil, nil
	}
}
func (e *Entry) getExecMatch(name string, matcher Matcher) ExecFunc {
	return func(method, urlStr string) (*Route, []string) {
		offset, matchStr := matcher.Match(urlStr)
		if offset == -1 {
			return nil, nil
		}

		// finish parsing
		if len(urlStr) == offset {
			if h := e.GetHandler(method); h != nil {
				return h, []string{name, matchStr}
			}
			return nil, nil
		}

		for _, entry := range e.entries {
			if h, params := entry.exec(method, urlStr[offset:]); h != nil {
				params = append(params, name, matchStr)
				return h, params
			}
		}
		return nil, nil
	}
}
func ( e * Entry ) getExecMatch ( name string , matcher Matcher ) ExecFunc { return func ( method , urlStr string ) ( * Route , [ ] string ) { offset , matchStr := matcher . Match ( urlStr ) if offset == - 1 { return nil , nil } // finish parsing if len ( urlStr ) == offset { if h := e . GetHandler ( method ) ; h != nil { return h , [ ] string { name , matchStr } } return nil , nil } for _ , entry := range e . entries { if h , params := entry . exec ( method , urlStr [ offset : ] ) ; h != nil { params = append ( params , name , matchStr ) return h , params } } return nil , nil } }
// getExecMatch returns ExecFunc with the given name and mather.
getExecMatch returns ExecFunc with the given name and mather .