code: func NewLoader(config *Config) (*Loader, error) {
  	fs := afero.NewOsFs()
  	parser := configs.NewParser(fs)
  	reg := registry.NewClient(config.Services, nil)
  
  	ret := &Loader{
  		parser: parser,
  		modules: moduleMgr{
  			FS:         afero.Afero{Fs: fs},
  			CanInstall: true,
  			Dir:        config.ModulesDir,
  			Services:   config.Services,
  			Registry:   reg,
  		},
  	}
  
  	err := ret.modules.readModuleManifestSnapshot()
  	if err != nil {
  		return nil, fmt.Errorf("failed to read module manifest: %s", err)
  	}
  
  	return ret, nil
  }
docs: // NewLoader creates and returns a loader that reads configuration from the
  // real OS filesystem.
  //
  // The loader has some internal state about the modules that are currently
  // installed, which is read from disk as part of this function. If that
  // manifest cannot be read then an error will be returned.