Implemented regex matching for type names.

pull/178/head
jackgr 9 years ago
parent 8b67285c52
commit 42f894d882

@ -81,7 +81,17 @@ func (g GithubPackageRegistry) ListTypes(regex *regexp.Regexp) ([]Type, error) {
}
}
// TODO(jackgr): Use the supplied regex to filter the results.
if regex != nil {
var matchTypes []Type
for _, retType := range retTypes {
if regex.MatchString(retType.String()) {
matchTypes = append(matchTypes, retType)
}
}
return matchTypes, nil
}
return retTypes, nil
}

@ -108,7 +108,17 @@ func (g GithubTemplateRegistry) ListTypes(regex *regexp.Regexp) ([]Type, error)
}
}
// TODO(jackgr): Use the supplied regex to filter the results.
if regex != nil {
var matchTypes []Type
for _, retType := range retTypes {
if regex.MatchString(retType.String()) {
matchTypes = append(matchTypes, retType)
}
}
return matchTypes, nil
}
return retTypes, nil
}

Loading…
Cancel
Save