- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 25 for DirEntry (0.2 sec)
-
cni/test/install_cni.go
} func ls(dir string, t *testing.T) []string { files, err := os.ReadDir(dir) t.Helper() if err != nil { t.Fatalf("Failed to list files, err: %v", err) } return slices.Map(files, func(e os.DirEntry) string { return e.Name() }) } func cp(src, dest string, t *testing.T) { t.Helper() data, err := os.ReadFile(src) if err != nil { t.Fatalf("Failed to read file %v, err: %v", src, err) }
Registered: Fri Jun 14 15:00:06 UTC 2024 - Last Modified: Tue May 21 18:32:01 UTC 2024 - 11.4K bytes - Viewed (0) -
src/cmd/vendor/golang.org/x/build/relnote/relnote.go
rem(1) return res } func sortedMarkdownFilenames(fsys fs.FS) ([]string, error) { var filenames []string err := fs.WalkDir(fsys, ".", func(path string, d fs.DirEntry, err error) error { if err != nil { return err } if !d.IsDir() && strings.HasSuffix(path, ".md") { filenames = append(filenames, path) } return nil }) if err != nil {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Tue Jun 04 16:19:04 UTC 2024 - 12.7K bytes - Viewed (0) -
src/cmd/go/internal/modfetch/fetch.go
func makeDirsReadOnly(dir string) { type pathMode struct { path string mode fs.FileMode } var dirs []pathMode // in lexical order filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { if err == nil && d.IsDir() { info, err := d.Info() if err == nil && info.Mode()&0222 != 0 { dirs = append(dirs, pathMode{path, info.Mode()}) } } return nil })
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 30 14:56:56 UTC 2024 - 30.3K bytes - Viewed (0) -
src/index/suffixarray/suffixarray_test.go
var err error data, err = os.ReadFile("../../testdata/Isaac.Newton-Opticks.txt") if err != nil { return nil, err } case "go": err := filepath.WalkDir("../..", func(path string, info fs.DirEntry, err error) error { if err == nil && strings.HasSuffix(path, ".go") && !info.IsDir() { file, err := os.ReadFile(path) if err != nil { return err } data = append(data, file...) }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 14.1K bytes - Viewed (0) -
src/os/file_unix.go
return d.info, nil } return lstat(d.parent + "/" + d.name) } func (d *unixDirent) String() string { return fs.FormatDirEntry(d) } func newUnixDirent(parent, name string, typ FileMode) (DirEntry, error) { ude := &unixDirent{ parent: parent, name: name, typ: typ, } if typ != ^FileMode(0) && !testingForceReadDirLstat { return ude, nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 13:52:34 UTC 2024 - 14.9K bytes - Viewed (0) -
src/path/filepath/path.go
// Readdirnames. type WalkFunc func(path string, info fs.FileInfo, err error) error var lstat = os.Lstat // for testing // walkDir recursively descends path, calling walkDirFn. func walkDir(path string, d fs.DirEntry, walkDirFn fs.WalkDirFunc) error { if err := walkDirFn(path, d, nil); err != nil || !d.IsDir() { if err == SkipDir && d.IsDir() { // Successfully skipped directory. err = nil } return err }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 15.5K bytes - Viewed (0) -
src/os/os_test.go
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 83.1K bytes - Viewed (0) -
src/go/build/deps_test.go
func listStdPkgs(goroot string) ([]string, error) { // Based on cmd/go's matchPackages function. var pkgs []string src := filepath.Join(goroot, "src") + string(filepath.Separator) walkFn := func(path string, d fs.DirEntry, err error) error { if err != nil || !d.IsDir() || path == src { return nil } base := filepath.Base(path) if strings.HasPrefix(base, ".") || strings.HasPrefix(base, "_") || base == "testdata" {
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Fri May 24 16:41:13 UTC 2024 - 19.2K bytes - Viewed (0) -
src/go/build/build.go
} // readDir calls ctxt.ReadDir (if not nil) or else os.ReadDir. func (ctxt *Context) readDir(path string) ([]fs.DirEntry, error) { // TODO: add a fs.DirEntry version of Context.ReadDir if f := ctxt.ReadDir; f != nil { fis, err := f(path) if err != nil { return nil, err } des := make([]fs.DirEntry, len(fis)) for i, fi := range fis { des[i] = fs.FileInfoToDirEntry(fi) } return des, nil }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Wed May 29 16:25:21 UTC 2024 - 62.3K bytes - Viewed (0) -
src/archive/tar/writer.go
// adding each file to the tar archive while maintaining the directory structure. func (tw *Writer) AddFS(fsys fs.FS) error { return fs.WalkDir(fsys, ".", func(name string, d fs.DirEntry, err error) error { if err != nil { return err } if d.IsDir() { return nil } info, err := d.Info() if err != nil { return err }
Registered: Wed Jun 12 16:32:35 UTC 2024 - Last Modified: Thu May 23 01:00:11 UTC 2024 - 19.6K bytes - Viewed (0)