feat: check empty name

This commit is contained in:
Kevin Franklin Kim 2023-02-14 17:29:33 +01:00
parent fd1fa6cc07
commit c258cdcc49

View File

@ -8,6 +8,9 @@ import (
func MkdirAll(paths ...string) error {
for _, path := range paths {
if path == "" {
return errors.New("invalid empty path")
}
if stat, err := os.Stat(path); err != nil && os.IsNotExist(err) {
if err := os.MkdirAll(path, os.ModeDir|0700); err != nil {
return err