application dynamics fixed and error handling done

This commit is contained in:
hysn99
2024-03-31 23:55:05 +03:00
parent 56fbba2ab7
commit 5ec8f05e16
5 changed files with 497 additions and 414 deletions

30
app/lib/helper/helper.go Normal file
View File

@@ -0,0 +1,30 @@
package helper
import (
"fmt"
"os"
)
type errorInfo struct {
Error string
Index int
}
func (e *errorInfo) ErrorHandle() {
//apiden veya txt ye yaz
}
func CreateFolder(folderName string) error {
if _, err := os.Stat(folderName); os.IsNotExist(err) {
// Klasör yoksa oluştur
err := os.Mkdir(folderName, 0755)
if err != nil {
fmt.Println("Klasör oluşturulamadı:", err)
return err
}
fmt.Println("Klasör oluşturuldu:", folderName)
} else {
fmt.Println("Klasör zaten var:", folderName)
}
return nil
}