duke-git / lancet

A comprehensive, efficient, and reusable util function library of Go.

Home Page:https://www.golancet.cn/en/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

There is an ambiguity in the use of the method `fileutil.CreateDir`

J404J opened this issue · comments

commented

There is an ambiguity in fileutil.CreateDir, the incoming path must end with /.
I input /a/b/c but create /a/b.
Since the function's name is CreateDir, the input params is dir not a file.
It is recommended that the semantics of the function be consistent with the mkdir -p command of the operating system, that will not cause ambiguity.
mkdir -p /a/b/c will create /a/b/c not /a/b

commented

remove path.Dir(absPath) -> os.MkdirAll(absPath, os.ModePerm)

okay, will fix it in next release.

commented

okay, will fix it in next release.

thank you!

fixed in v2.2.4

commented

fixed in v2.2.4

thank you!