fehlerbehebung
This commit is contained in:
parent
e278c6f851
commit
6df99b809c
8
file.go
8
file.go
|
@ -29,15 +29,12 @@ func fileAddLine(input string, filepath string) {
|
|||
}
|
||||
|
||||
func fileCreate(filepath string) {
|
||||
if _, err := os.Stat(filepath); err == nil {
|
||||
_, err := os.Stat(filepath)
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
_, err := os.Create(filepath)
|
||||
errorPanic(err)
|
||||
|
||||
logger("fileCreate : file created -> " + filepath)
|
||||
} else if errors.Is(err, os.ErrNotExist) {
|
||||
logger("fileCreate : file already exists -> " + filepath)
|
||||
} else {
|
||||
logger("fileCreate : unknown -> " + filepath)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,5 +43,6 @@ func fileMkDir(folderpath string) {
|
|||
if errors.Is(err, os.ErrNotExist) {
|
||||
err = os.Mkdir(folderpath, 0755)
|
||||
errorPanic(err)
|
||||
logger("fileMkDir : folder created -> " + folderpath)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue