This commit is contained in:
cubixle
2021-06-18 22:24:54 +01:00
parent ea33f7060b
commit cf2cc2a706
6 changed files with 50 additions and 50 deletions
+19
View File
@@ -0,0 +1,19 @@
package main
import (
"os"
"path/filepath"
)
func createFile(path string) (*os.File, error) {
fp := filepath.Dir(path)
if err := os.MkdirAll(fp, 0777); err != nil {
return nil, err
}
f, err := os.Create(path)
if err != nil {
return nil, err
}
return f, nil
}