afero icon indicating copy to clipboard operation
afero copied to clipboard

memfs directory can be read by ReadFile

Open meza opened this issue 6 months ago • 0 comments

When you have a test doing something like this:

	configFile := filepath.Join(t.TempDir(), "config")
	_ = os.Mkdir(configFile, 0755)

and the file under tests does a afero.ReadFile(fs, configPath), the call returns without an error and an empty result instead of failing on the fact that the configPath is a directory.

The same code works as expected on osfs

meza avatar Aug 19 '24 20:08 meza