fehlerbehebung
This commit is contained in:
parent
989d15a4c2
commit
076d92ba93
8
file.go
8
file.go
|
@ -29,15 +29,12 @@ func fileAddLine(input string, filepath string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func fileCreate(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)
|
_, err := os.Create(filepath)
|
||||||
errorPanic(err)
|
errorPanic(err)
|
||||||
|
|
||||||
logger("fileCreate : file created -> " + filepath)
|
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) {
|
if errors.Is(err, os.ErrNotExist) {
|
||||||
err = os.Mkdir(folderpath, 0755)
|
err = os.Mkdir(folderpath, 0755)
|
||||||
errorPanic(err)
|
errorPanic(err)
|
||||||
|
logger("fileMkDir : folder created -> " + folderpath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue