func New(registry *modregistry.Client, dir string) (modload.Registry, error)
New returns r wrapped inside a caching layer that stores persistent cached content inside the given OS directory.
The `module.SourceLoc.FS` fields in the locations returned by the registry implement the `OSRootFS` interface, allowing a caller to find the native OS filepath where modules are stored.
func RemoveAll(dir string) error
RemoveAll removes a directory written by the cache, first applying any permission changes needed to do so.