afero
afero copied to clipboard
memfs directory can be read by ReadFile
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