Commit 42f894d8 authored by jackgr's avatar jackgr

Implemented regex matching for type names.

parent 8b67285c
......@@ -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
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment