INNER CODE UNIT · Go
isTestFunction
cweill/gotests · gotests.go:197
func isTestFunction(f *models.Function, testFuncs []string) bool {
return len(testFuncs) > 0 && contains(testFuncs, f.TestName())
}
func isExcluded(f *models.Function, excl *regexp.Regexp) bool {
return excl != nil && (excl.MatchString(f.Name) || excl.MatchString(f.FullName()))
}
func isUnexported(f *models.Function, exp bool) bool {
return exp && !f.IsExported
}
func isIncluded(f *models.Function, only *regexp.Regexp) bool {
return only == nil || only.MatchString(f.Name) || only.MatchString(f.FullName())
}
func contains(ss []string, s string) bool {
if i := sort.SearchStrings(ss, s); i < len(ss) && ss[i] == s {