fehlerbehebung
This commit is contained in:
parent
5ba64e7efb
commit
7eb828a6f2
11
file.go
11
file.go
|
@ -17,8 +17,7 @@ func fileRead(src string) string {
|
||||||
func fileAddLine(input string, filepath string) {
|
func fileAddLine(input string, filepath string) {
|
||||||
_, err := os.Stat(filepath)
|
_, err := os.Stat(filepath)
|
||||||
if errors.Is(err, os.ErrNotExist) {
|
if errors.Is(err, os.ErrNotExist) {
|
||||||
_, err = os.Create(filepath)
|
fileCreate(filepath)
|
||||||
errorPanic(err)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var file *os.File
|
var file *os.File
|
||||||
|
@ -28,3 +27,11 @@ func fileAddLine(input string, filepath string) {
|
||||||
_, err = file.WriteString(input + "\n")
|
_, err = file.WriteString(input + "\n")
|
||||||
errorPanic(err)
|
errorPanic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func fileCreate(filepath string) {
|
||||||
|
_, err := os.Create(filepath)
|
||||||
|
|
||||||
|
errorPanic(err)
|
||||||
|
|
||||||
|
logger("file created -> " + filepath)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue