application dynamics fixed and error handling done
This commit is contained in:
30
app/lib/helper/helper.go
Normal file
30
app/lib/helper/helper.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user