Explorar el Código

Fix file extension check

Kailash Nadh hace 6 años
padre
commit
8e10bf3b16
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      subimporter/importer.go

+ 1 - 1
subimporter/importer.go

@@ -297,7 +297,7 @@ func (s *Session) ExtractZIP(srcPath string, maxCSVs int) (string, []string, err
 		}
 
 		// Skip files without the .csv extension.
-		if !strings.Contains(strings.ToLower(fName), "csv") {
+		if !strings.HasSuffix(strings.ToLower(fName), ".csv") {
 			s.log.Printf("skipping non .csv file '%s'", fName)
 			continue
 		}