Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 662 for walkFn (0.11 sec)

  1. src/path/filepath/path.go

    		}
    	}
    	return nil
    }
    
    // walk recursively descends path, calling walkFn.
    func walk(path string, info fs.FileInfo, walkFn WalkFunc) error {
    	if !info.IsDir() {
    		return walkFn(path, info, nil)
    	}
    
    	names, err := readDirNames(path)
    	err1 := walkFn(path, info, err)
    	// If err != nil, walk can't walk into this directory.
    	// err1 != nil means walkFn want walk to skip this directory or stop walking.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 15.5K bytes
    - Viewed (0)
  2. src/cmd/go/internal/fsys/fsys.go

    		if err := walk(filename, fi, walkFn); err != nil {
    			if !fi.IsDir() || err != filepath.SkipDir {
    				return err
    			}
    		}
    	}
    	return nil
    }
    
    // Walk walks the file tree rooted at root, calling walkFn for each file or
    // directory in the tree, including root.
    func Walk(root string, walkFn filepath.WalkFunc) error {
    	Trace("Walk", root)
    	info, err := Lstat(root)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 18:35:34 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  3. pkg/util/filesystem/defaultfs.go

    // ReadDir via os.ReadDir
    func (fs *DefaultFs) ReadDir(dirname string) ([]os.DirEntry, error) {
    	return os.ReadDir(fs.prefix(dirname))
    }
    
    // Walk via filepath.Walk
    func (fs *DefaultFs) Walk(root string, walkFn filepath.WalkFunc) error {
    	return filepath.Walk(fs.prefix(root), walkFn)
    }
    
    // defaultFile implements File using same-named functions from "os"
    type defaultFile struct {
    	file *os.File
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 03 07:38:14 UTC 2023
    - 4.7K bytes
    - Viewed (0)
  4. pkg/util/iptree/iptree.go

    		count++
    		return false
    	})
    	return count
    }
    
    // WalkFn is used when walking the tree. Takes a
    // key and value, returning if iteration should
    // be terminated.
    type WalkFn[T any] func(s netip.Prefix, v T) bool
    
    // DepthFirstWalk is used to walk the tree of the corresponding IP family
    func (t *Tree[T]) DepthFirstWalk(isIPv6 bool, fn WalkFn[T]) {
    	if isIPv6 {
    		recursiveWalk(t.rootV6, fn)
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Oct 31 21:05:04 UTC 2023
    - 17.7K bytes
    - Viewed (0)
  5. pkg/util/filesystem/filesystem.go

    	// from "os"
    	ReadFile(filename string) ([]byte, error)
    	TempDir(dir, prefix string) (string, error)
    	TempFile(dir, prefix string) (File, error)
    	ReadDir(dirname string) ([]os.DirEntry, error)
    	Walk(root string, walkFn filepath.WalkFunc) error
    }
    
    // File is an interface that we can use to mock various filesystem operations typically
    // accessed through the File object from the "os" package
    type File interface {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Apr 13 01:02:46 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  6. src/path/filepath/path_test.go

    		t.Helper()
    		sawFoo2 = false
    		err := walk(root)
    		if err != nil {
    			t.Fatal(err)
    		}
    		if sawFoo2 {
    			t.Errorf("SkipDir on file foo1 did not block processing of foo2")
    		}
    	}
    
    	t.Run("Walk", func(t *testing.T) {
    		Walk := func(root string) error { return filepath.Walk(td, walkFn) }
    		check(t, Walk, td)
    		check(t, Walk, filepath.Join(td, "dir"))
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 22 16:38:19 UTC 2024
    - 47.1K bytes
    - Viewed (0)
  7. 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)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 16:41:13 UTC 2024
    - 19.2K bytes
    - Viewed (0)
  8. src/cmd/go/internal/fsys/fsys_test.go

    			var got []string
    
    			err := Walk(tc.dir, func(path string, info fs.FileInfo, err error) error {
    				t.Logf("walk %q", path)
    				got = append(got, path)
    				if err != nil {
    					t.Errorf("walkfn: got non nil err argument: %v, want nil err argument", err)
    				}
    				return nil
    			})
    			if err != nil {
    				t.Errorf("Walk: got error %q, want nil", err)
    			}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 18:52:11 UTC 2023
    - 29.1K bytes
    - Viewed (0)
  9. src/cmd/compile/internal/syntax/walk.go

    // walked multiple times.
    // TODO(gri) Revisit this design. It may make sense to walk those nodes
    // only once. A place where this matters is types2.TestResolveIdents.
    func Walk(root Node, v Visitor) {
    	walker{v}.node(root)
    }
    
    // A Visitor's Visit method is invoked for each node encountered by Walk.
    // If the result visitor w is not nil, Walk visits each of the children
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:55:04 UTC 2023
    - 5.7K bytes
    - Viewed (0)
  10. src/io/fs/walk.go

    				break
    			}
    			return err
    		}
    	}
    	return nil
    }
    
    // WalkDir walks the file tree rooted at root, calling fn for each file or
    // directory in the tree, including root.
    //
    // All errors that arise visiting files and directories are filtered by fn:
    // see the [fs.WalkDirFunc] documentation for details.
    //
    // The files are walked in lexical order, which makes the output deterministic
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 09 08:50:19 UTC 2024
    - 4.7K bytes
    - Viewed (0)
Back to top