Skip to content

Commit fd39e6d

Browse files
authored
Fixes #16557 - duplicate csv import (#16631)
Remove the unnecessary duplicate package import for `encoding/csv` in `modules/csv/csv.go` Fix #16557
1 parent 3a1332c commit fd39e6d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

modules/csv/csv.go

Lines changed: 2 additions & 3 deletions
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)