fix header detection (oops)

Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
Hadi
2025-11-03 13:34:38 +01:00
parent a3daa41fa0
commit 7a29929eb3

View File

@@ -97,7 +97,7 @@ func csvHasHeader(inputFile, delimiter string) (hasHeader bool, err error) {
knownHeaders := []string{"email", "password", "username", "phone", "lastname", "firstname", "mail", "addresse", "nom", "id"} knownHeaders := []string{"email", "password", "username", "phone", "lastname", "firstname", "mail", "addresse", "nom", "id"}
for _, knownHeader := range knownHeaders { for _, knownHeader := range knownHeaders {
for _, col := range firstRow { for _, col := range firstRow {
if strings.HasPrefix(col, "_"+knownHeader) || col == knownHeader { if strings.HasSuffix(col, knownHeader) {
return true, nil return true, nil
} }
} }