dirwalk

package
v1.106.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: BSD-3-Clause Imports: 10 Imported by: 4 modules, 6 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package dirwalk contains code to walk a directory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WalkShallow

func WalkShallow(dirName mem.RO, fn WalkFunc) error

WalkShallow reads the entries in the named directory and calls fn for each. It does not recurse into subdirectories.

If fn returns an error, iteration stops and WalkShallow returns that value.

On Linux, WalkShallow does not allocate, so long as certain methods on the WalkFunc's DirEntry are not called which necessarily allocate.

Types

type WalkFunc

type WalkFunc func(name mem.RO, de fs.DirEntry) error

WalkFunc is the callback type used with WalkShallow.

The name and de are only valid for the duration of func's call and should not be retained.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL