mirror of
https://github.com/golang/go.git
synced 2024-09-21 18:38:37 +00:00
io/fs: remove contains
Change-Id: I59b479317fcdba5e60f4e65b00051133ee91a1b2
This commit is contained in:
parent
619b419a4b
commit
da03963a07
@ -8,6 +8,7 @@ import (
|
||||
. "io/fs"
|
||||
"os"
|
||||
"path"
|
||||
"slices"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
@ -30,7 +31,7 @@ func TestGlob(t *testing.T) {
|
||||
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)
|
||||
}
|
||||
}
|
||||
@ -65,16 +66,6 @@ func TestCVE202230630(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// 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 }
|
||||
|
Loading…
Reference in New Issue
Block a user