func (r *FsReadCloser) Close() error {
	return nil
}
Close is a no op for an FsReadCloser.
package parser
import (
	"io"
	"os"
	"path/filepath"
	"github.com/spf13/afero"
)
var _ AnnotatedReadCloser = &FsReadCloser{}
type FsReadCloserAnnotation struct {
	path     string
	position int
}
type FsReadCloser struct {
	fs         afero.Fs
	dir        string
	paths      []string
	index      int
	position   int
	writeBreak bool
	wroteBreak bool
}
type FilterFn func(path string, info os.FileInfo) (bool, error)
func SkipPath(pattern string) FilterFn {
	return func(path string, info os.FileInfo) (bool, error) {
		return filepath.Match(pattern, path)
	}
}
func SkipDirs() FilterFn {
	return func(path string, info os.FileInfo) (bool, error) {
		if info.IsDir() {
			return true, nil
		}
		return false, nil
	}
}
func SkipEmpty() FilterFn {
	return func(path string, info os.FileInfo) (bool, error) {
		return info.Size() == 0, nil
	}
}
func SkipNotYAML() FilterFn {
	return func(path string, info os.FileInfo) (bool, error) {
		if filepath.Ext(path) != ".yaml" && filepath.Ext(path) != ".yml" {
			return true, nil
		}
		return false, nil
	}
}
func NewFsReadCloser(fs afero.Fs, dir string, fns ...FilterFn) (*FsReadCloser, error) {
	paths := []string{}
	err := afero.Walk(fs, dir, func(path string, info os.FileInfo, err error) error {
		if err != nil {
			return err
		}
		for _, fn := range fns {
			filter, err := fn(path, info)
			if err != nil {
				return err
			}
			if filter {
				return nil
			}
		}
		paths = append(paths, path)
		return nil
	})
	return &FsReadCloser{
		fs:         fs,
		dir:        dir,
		paths:      paths,
		index:      0,
		position:   0,
		writeBreak: false,
		wroteBreak: false,
	}, err
}
func (r *FsReadCloser) Read(p []byte) (n int, err error) {
	if r.wroteBreak {
		r.index++
		r.position = 0
		r.wroteBreak = false
		n = copy(p, "\n---\n")
		return n, nil
	}
	if r.index == len(r.paths) {
		return 0, io.EOF
	}
	if r.writeBreak {
		n = copy(p, "\n...\n")
		r.writeBreak = false
		r.wroteBreak = true
		return n, nil
	}
	b, err := afero.ReadFile(r.fs, r.paths[r.index])
	n = copy(p, b[r.position:])
	r.position += n
	if err == io.EOF || n == 0 {
		r.writeBreak = true
		err = nil
	}
	return n, err
}