Skip to content

Commit 86a1b31

Browse files
committed
feat: change function name for clarification
1 parent 537cfd4 commit 86a1b31

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

csv/read.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"os"
88
)
99

10-
// The Read function reads data from a CSV file located at the specified filePath, with the specified separator.
11-
// It returns a slice of models.ReadCsv structs containing the data from the CSV file, excluding the header.
12-
func Read(filePath string, separator rune, skipHeaderLine bool) ([]models.ReadCsv, error) {
10+
// The ReadLawsuit function reads data from a CSV file located at the specified filePath, with the specified separator.
11+
// It returns a slice of models.ReadCsvLaawsuit structs containing the data from the CSV file, excluding the header.
12+
func ReadLawsuit(filePath string, separator rune, skipHeaderLine bool) ([]models.ReadCsvLaawsuit, error) {
1313
csvFile, err := os.Open(filePath)
1414
if err != nil {
1515
log.Println(err)
@@ -26,19 +26,19 @@ func Read(filePath string, separator rune, skipHeaderLine bool) ([]models.ReadCs
2626
return nil, err
2727
}
2828

29-
var data []models.ReadCsv
29+
var data []models.ReadCsvLaawsuit
3030
for i, line := range csvData {
3131
if skipHeaderLine {
3232
// Skip the header line
3333
if i != 0 {
3434
document := line[0]
35-
data = append(data, models.ReadCsv{
35+
data = append(data, models.ReadCsvLaawsuit{
3636
CNJNumber: document,
3737
})
3838
}
3939
} else {
4040
document := line[0]
41-
data = append(data, models.ReadCsv{
41+
data = append(data, models.ReadCsvLaawsuit{
4242
CNJNumber: document,
4343
})
4444
}

0 commit comments

Comments
 (0)