fix header detection (oops)
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user