Skip to content

Commit 432d48c

Browse files
committed
Fixes #16557 - duplicate csv import
1 parent 3a1332c commit 432d48c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/csv/csv.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package csv
66

77
import (
88
"bytes"
9-
"encoding/csv"
109
stdcsv "encoding/csv"
1110
"errors"
1211
"io"
@@ -97,9 +96,9 @@ func scoreDelimiter(lines []string, delim rune) float64 {
9796

9897
// FormatError converts csv errors into readable messages.
9998
func FormatError(err error, locale translation.Locale) (string, error) {
100-
var perr *csv.ParseError
99+
var perr *stdcsv.ParseError
101100
if errors.As(err, &perr) {
102-
if perr.Err == csv.ErrFieldCount {
101+
if perr.Err == stdcsv.ErrFieldCount {
103102
return locale.Tr("repo.error.csv.invalid_field_count", perr.Line), nil
104103
}
105104
return locale.Tr("repo.error.csv.unexpected", perr.Line, perr.Column), nil

0 commit comments

Comments
 (0)