. "io/fs"
"os"
"path"
+ "slices"
"strings"
"testing"
)
t.Errorf("Glob error for %q: %s", tt.pattern, err)
continue
}
- if !contains(matches, tt.result) {
+ if !slices.Contains(matches, tt.result) {
t.Errorf("Glob(%#q) = %#v want %v", tt.pattern, matches, tt.result)
}
}
}
}
-// contains reports whether vector contains the string s.
-func contains(vector []string, s string) bool {
- for _, elem := range vector {
- if elem == s {
- return true
- }
- }
- return false
-}
-
type globOnly struct{ GlobFS }
func (globOnly) Open(name string) (File, error) { return nil, ErrNotExist }