This repository has been archived on 2024-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
treefmt/internal/walk/filesystem.go

23 lines
366 B
Go
Raw Normal View History

package walk
import (
"context"
"path/filepath"
)
type filesystemWalker struct {
root string
}
func (f filesystemWalker) Root() string {
return f.root
}
func (f filesystemWalker) Walk(_ context.Context, fn filepath.WalkFunc) error {
return filepath.Walk(f.root, fn)
}
func NewFilesystem(root string) (Walker, error) {
return filesystemWalker{root}, nil
}