afero icon indicating copy to clipboard operation
afero copied to clipboard

BasePathFs.MkdirAll fail to create from a empty basepath

Open draeron opened this issue 3 years ago • 0 comments

Lib Version: 1.6.0 Go Version: 1.17

The problem seems to be caused here. The function filepath.clean will return a dot if empty. The call on the next line will not contains the dot as the same filepath.clean will remove the dot if non empty.

Then the function will always returns a os.ErrNotExist, preventing MkdirAll to work.

https://github.com/spf13/afero/blob/master/basepath.go#L47

draeron avatar Sep 13 '21 18:09 draeron