// NewFakeLoaderWithRestrictor returns a Loader that
// uses a fake filesystem.
// The initialDir argument should be an absolute file path.
NewFakeLoaderWithRestrictor returns a Loader that
uses a fake filesystem.
The initialDir argument should be an absolute file path.
// NewFakeLoaderWithRestrictor returns a Loader that // uses a fake filesystem . // The initialDir argument should be an absolute file path .
func NewFakeLoaderWithRestrictor(
	lr loader.LoadRestrictorFunc, initialDir string) FakeLoader {
	fSys := fs.MakeFakeFS()
	fSys.Mkdir(initialDir)
	ldr, err := loader.NewLoader(
		lr, validators.MakeFakeValidator(), initialDir, fSys)
	if err != nil {
		log.Fatalf("Unable to make loader: %v", err)
	}
	return FakeLoader{fs: fSys, delegate: ldr}
}
func NewFakeLoaderWithRestrictor ( lr loader . LoadRestrictorFunc , initialDir string ) FakeLoader { fSys := fs . MakeFakeFS ( ) fSys . Mkdir ( initialDir ) ldr , err := loader . NewLoader ( lr , validators . MakeFakeValidator ( ) , initialDir , fSys ) if err != nil { log . Fatalf ( " " , err ) } return FakeLoader { fs : fSys , delegate : ldr } }
NewFakeLoaderWithRestrictor returns a Loader that
uses a fake filesystem.
NewFakeLoaderWithRestrictor returns a Loader that uses a fake filesystem .
// Create fake filesystem and inject it into initial Loader.