searchpath

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAbort = errors.New("abort visitation")

ErrAbort can be returned from a visitation func to terminate iteration.

Functions

func Visit

func Visit(relpath string, visitFn func(f *os.File) error) error

Visit visits all searchpaths looking for extant files at relative path relpath, opening each file and calling visitFn on it (in searchpath order). The files are closed by Visit. If visitFn returns ErrAbort, Visit stops traversal and returns nil.

func VisitPaths

func VisitPaths(relath string, visitFn func(fp string) error) error

VisitPaths is as Visit, but only passes the filepath to visitFn, without opening it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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