dirwalk

package
v0.0.0-...-9d29f1b Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

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