Files
BordroRobot/app/lib/helper/helper.go

31 lines
534 B
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
}