Skip to content

Commit

Permalink
func to create folder
Browse files Browse the repository at this point in the history
Signed-off-by: Thiago Pagotto <pagottoo@gmail.com>
  • Loading branch information
pagottoo committed Jul 19, 2022
1 parent 0386711 commit 3a96e8e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,3 +146,10 @@ func CreateFile(fileName string, fileContent []byte) error {
}
return nil
}

func CreateFullPath(p string) (*os.File, error) {
if err := os.MkdirAll(filepath.Dir(p), 0770); err != nil {
return nil, err
}
return os.Create(p)
}

0 comments on commit 3a96e8e

Please sign in to comment.