Help us shape the future of Go! Take the 2026 Go Developer Survey

fs

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

Package fs provides predicates over io/fs.FileInfo, derived from the FileInfo interface methods.

Index

Constants

This section is empty.

Variables

View Source
var (
	// IsDirInfo is a Predicate[iofs.FileInfo] that is true when the
	// FileInfo reports a directory. Compose it with P.ContraMap and
	// any extractor to lift it onto a state type.
	IsDirInfo = func(fi iofs.FileInfo) bool { return fi.IsDir() }

	// IsRegularInfo is a Predicate[iofs.FileInfo] that is true when
	// the FileInfo reports a regular file. Compose it with P.ContraMap
	// and any extractor to lift it onto a state type.
	IsRegularInfo = func(fi iofs.FileInfo) bool { return fi.Mode().IsRegular() }
)

Functions

func IsDir

func IsDir[S any](get func(S) iofs.FileInfo) P.Predicate[S]

IsDir returns a Predicate[S] that is true when the FileInfo extracted from a value of type S reports a directory. The extractor must return a non-nil FileInfo; pass a lens getter for callers that own a lens.

func IsRegular

func IsRegular[S any](get func(S) iofs.FileInfo) P.Predicate[S]

IsRegular returns a Predicate[S] that is true when the FileInfo extracted from a value of type S reports a regular file. The extractor must return a non-nil FileInfo; pass a lens getter for callers that own a lens.

Types

This section is empty.

Jump to

Keyboard shortcuts

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