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) {
|
||||
_, err := os.Stat(filepath)
|
||||
if errors.Is(err, os.ErrNotExist) {
|
||||
_, err = os.Create(filepath)
|
||||
errorPanic(err)
|
||||
fileCreate(filepath)
|
||||
}
|
||||
|
||||
var file *os.File
|
||||
|
@ -28,3 +27,11 @@ func fileAddLine(input string, filepath string) {
|
|||
_, err = file.WriteString(input + "\n")
|
||||
errorPanic(err)
|
||||
}
|
||||
|
||||
func fileCreate(filepath string) {
|
||||
_, err := os.Create(filepath)
|
||||
|
||||
errorPanic(err)
|
||||
|
||||
logger("file created -> " + filepath)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue