code: func (l *Loader) makeModuleWalkerSnapshot(snap *Snapshot) configs.ModuleWalker {
  	return configs.ModuleWalkerFunc(
  		func(req *configs.ModuleRequest) (*configs.Module, *version.Version, hcl.Diagnostics) {
  			mod, v, diags := l.moduleWalkerLoad(req)
  			if diags.HasErrors() {
  				return mod, v, diags
  			}
  
  			key := l.modules.manifest.ModuleKey(req.Path)
  			record, exists := l.modules.manifest[key]
  
  			if !exists {
  				// Should never happen, since otherwise moduleWalkerLoader would've
  				// returned an error and we would've returned already.
  				panic(fmt.Sprintf("module %s is not present in manifest", key))
  			}
  
  			addDiags := l.addModuleToSnapshot(snap, key, record.Dir, record.SourceAddr, record.Version)
  			diags = append(diags, addDiags...)
  
  			return mod, v, diags
  		},
  	)
  }
docs: // makeModuleWalkerSnapshot creates a configs.ModuleWalker that will exhibit
  // the same lookup behaviors as l.moduleWalkerLoad but will additionally write
  // source files from the referenced modules into the given snapshot.