gitlab.com/evatix-go/core@v1.3.55/chmodhelper/CreateDirsWithFiles.go (about)

     1  package chmodhelper
     2  
     3  import "os"
     4  
     5  func CreateDirsWithFiles(
     6  	isRemoveAllDirBeforeCreate bool,
     7  	fileChmod os.FileMode,
     8  	dirsWithFiles ...DirWithFiles,
     9  ) error {
    10  	if dirsWithFiles == nil || len(dirsWithFiles) == 0 {
    11  		return nil
    12  	}
    13  
    14  	for _, dirWithFile := range dirsWithFiles {
    15  		err := CreateDirWithFiles(
    16  			isRemoveAllDirBeforeCreate,
    17  			fileChmod,
    18  			&dirWithFile)
    19  
    20  		if err != nil {
    21  			return err
    22  		}
    23  	}
    24  
    25  	return nil
    26  }